-
Notifications
You must be signed in to change notification settings - Fork 71
Symfony 2.8 Support #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
+1 |
if(true === class_exists('\AppKernel')) { | ||
$app = new \AppKernel($this->appenv, $this->debug); | ||
} else { | ||
require_once './app/bootstrap.php.cache'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should check first if this file exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
symfony 2.8 loader symfony 2.8 app kernel loader fix bridge fix symfony2.8 for the win
if(class_exists('\AppKernel')) { | ||
$app = new \AppKernel($this->appenv, $this->debug); | ||
} else { | ||
if(file_exists('./app/bootstrap.php.cache') && file_exists('./app/AppKernel.php')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./app/bootstrap.php.cache
may not exists beside app/AppKernel
, so you should really check both individually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is even the correct way to check if \AppKernel
exists, because when class_exists
returns false, it means the autoloader isn't configured correctly, which also means all namespaces and classes inside app/AppKernel.php
can't be resolved, so requiring this file will fail. So I think './app/AppKernel.php'
should be excluded here completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole thing at line 55 should be replaced with
if(file_exists('./app/bootstrap.php.cache')) {
require_once './app/bootstrap.php.cache';
}
$app = new \AppKernel($this->appenv, $this->debug);
because if \AppKernel
isn't there at this point requiring app/AppKernel.php
would change that much as it will fail without an= correctly configured autoloader anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but with symfony 2.8 it cannot start with this. I need to require_once './app/AppKernel.php';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without it throws an error:
Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Fatal error: Class 'AppKernel' not found in /foo/bar/vendor/php-pm/httpkernel-adapter/Bootstraps/Symfony.php:58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mh, interesting. In my Symfony 2.8 everything works correctly. I used http://symfony.com/doc/current/book/installation.html. How have you installed Symfony 2.8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, maybe you just upgraded from a older version or used a version pre November 2015, where AppKernel is not in the composer.json (like in the README.md of this repo noted). So, then let us require that file if it exists. But please check both files individually, app/AppKernel and app/bootstrap.php.cache. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the pre 2.5 style of installation. Ex. cache is in app/cache instead of var/cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any news?
I have the same problem with 2.8, I had to apply the changes of this PR in order to get around the " |
I made some fixes and enhancements to provide symfony2.8 support.