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