8000 Error bootstrap.php.cache after 3.2 upgrade · Issue #20753 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Error bootstrap.php.cache after 3.2 upgrade #20753

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

Closed
ghost opened this issue Dec 5, 2016 · 3 comments
Closed

Error bootstrap.php.cache after 3.2 upgrade #20753

ghost opened this issue Dec 5, 2016 · 3 comments

Comments

@ghost
Copy link
ghost commented Dec 5, 2016

HI,

I have updated to 3.2 but I get the following error:

PHP Fatal error: Cannot redeclare class Symfony\\Component\\HttpKernel\\HttpKernelInterface in /var/www/application/var/bootstrap.php.cache on line 1309

I cleared the cache but without success.
When I removed the bootstrap.php.cache file everything worked as expected. After the composer update the bootstrap file was regenerated with the same error being present.

line 1309 to 1339:

interface HttpKernelInterface
{
const MASTER_REQUEST = 1;
const SUB_REQUEST = 2;
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
}
}
namespace Symfony\Component\HttpKernel
{
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\Config\Loader\LoaderInterface;
interface KernelInterface extends HttpKernelInterface, \Serializable
{
public function registerBundles();
public function registerContainerConfiguration(LoaderInterface $loader);
public function boot();
public function shutdown();
public function getBundles();
public function getBundle($name, $first = true);
public function locateResource($name, $dir = null, $first = true);
public function getName();
public function getEnvironment();
public function isDebug();
public function getRootDir();
public function getContainer();
public function getStartTime();
public function getCacheDir();
public function getLogDir();
public function getCharset();
}
@nicolas-grekas
Copy link
Member

Do you call addClassesToCompile in your bundle? Did you put AppKernel in the list? Then that may be the issue.

@rodush
Copy link
rodush commented Dec 5, 2016

Hi! I've gotten similar problem with one of my applications, so I was wondering what makes it different from another, which worked perfectly fine after upgrade to 3.2
I took a look at symfony demo application's composer.json
... and found that in my composer.json I had these lines:

-        "psr-0": {
-            "": "src/"
-        },
-        "files": ["app/AppKernel.php"]
+        "psr-4": {"": "src/"},
+        "classmap": ["app/AppKernel.php", "app/AppCache.php"]

so after I changed files to classmap it started working fine.

@lisachenko
Copy link

This could be solved by #20668 )

fabpot added a commit to sensiolabs/SensioDistributionBundle that referenced this issue Dec 6, 2016
This PR was merged into the 5.0.x-dev branch.

Discussion
----------

Dont inline Kernel when already there

As spotted in symfony/symfony#20753 (comment)
`Kernel` inlining is not compatible with old `"files": ["app/AppKernel.php"]` entries in composer.json

Commits
-------

7046e6e Dont inline Kernel when already there
@fabpot fabpot closed this as completed Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
0