Skip to content

Commit 20f46e5

Browse files
committed
symfony 2.8 app kernel loader fix
1 parent c21e967 commit 20f46e5

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

Bootstraps/Symfony.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,21 @@ public function getStaticDirectory()
4545
*/
4646
public function getApplication()
4747
{
48-
49-
5048
// include applications autoload
5149
$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';
6359
require_once './app/AppKernel.php';
6460
$app = new \AppKernel($this->appenv, $this->debug);
6561
}
66-
67-
6862
//since we need to change some services, we need to manually change some services
69-
70-
7163
//we need to change some services, before the boot, because they would otherwise
7264
//be instantiated and passed to other classes which makes it impossible to replace them.
7365
Utils::bindAndCall(function () use ($app) {

0 commit comments

Comments
 (0)