@@ -45,29 +45,21 @@ public function getStaticDirectory()
45
45
*/
46
46
public function getApplication ()
47
47
{
48
-
49
-
50
48
// include applications autoload
51
49
$ appAutoLoader = './app/autoload.php ' ;
52
- try {
53
-
54
- if (file_exists ($ appAutoLoader )) {
55
- require $ appAutoLoader ;
56
- $ app = new \AppKernel ($ this ->appenv , $ this ->debug );
57
- } elseif (file_exists ('./vendor/autoload.php ' )) {
58
- require './vendor/autoload.php ' ;
59
- $ app = new \AppKernel ($ this ->appenv , $ this ->debug );
60
- }
61
- } catch (\Exception $ e ) {
62
- $ loader = require_once './app/bootstrap.php.cache ' ;
50
+ if (file_exists ($ appAutoLoader )) {
51
+ require $ appAutoLoader ;
52
+ } elseif (file_exists ('./vendor/autoload.php ' )) {
53
+ require './vendor/autoload.php ' ;
54
+ }
55
+ if (true === class_exists ('\AppKernel ' )) {
56
+ $ app = new \AppKernel ($ this ->appenv , $ this ->debug );
57
+ } else {
58
+ require_once './app/bootstrap.php.cache ' ;
63
59
require_once './app/AppKernel.php ' ;
64
60
$ app = new \AppKernel ($ this ->appenv , $ this ->debug );
65
61
}
66
-
67
-
68
62
//since we need to change some services, we need to manually change some services
69
-
70
-
71
63
//we need to change some services, before the boot, because they would otherwise
72
64
//be instantiated and passed to other classes which makes it impossible to replace them.
73
65
Utils::bindAndCall (function () use ($ app ) {
0 commit comments