File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,7 @@ public function getApplication()
32
32
require_once './app/AppKernel.php ' ;
33
33
}
34
34
35
- $ info = new \ReflectionClass ('AppKernel ' );
36
- $ appDir = dirname ($ info ->getFileName ());
37
- $ symfonyAutoload = $ appDir . '/autoload.php ' ;
38
- if (is_file ($ symfonyAutoload )) {
39
- require_once $ symfonyAutoload ;
40
- }
35
+ $ this ->includeAutoload ();
41
36
42
37
$ app = new \AppKernel ($ this ->appenv , false );
43
38
$ app ->loadClassCache ();
@@ -52,4 +47,22 @@ public function getStack(Builder $stack)
52
47
{
53
48
return $ stack ;
54
49
}
50
+
51
+ /**
52
+ * Includes the autoload file from the app directory, if available.
53
+ *
54
+ * The Symfony standard edition configures the annotation class loading
55
+ * in that file.
56
+ * The alternative bootstrap.php.cache cannot be included as that leads
57
+ * to "Cannot redeclare class" error, when starting php-pm.
58
+ */
59
+ protected function includeAutoload ()
60
+ {
61
+ $ info = new \ReflectionClass ('AppKernel ' );
62
+ $ appDir = dirname ($ info ->getFileName ());
63
+ $ symfonyAutoload = $ appDir . '/autoload.php ' ;
64
+ if (is_file ($ symfonyAutoload )) {
65
+ require_once $ symfonyAutoload ;
66
+ }
67
+ }
55
68
}
You can’t perform that action at this time.
0 commit comments