I am tasked with updating a symfony 2.3 app. It went out of style a loong time ago...
The error I get from both app_dev.php and when trying to run the symfony console is:
Fatal error: Cannot use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag as ParameterBag because the name is already in use in /myPath/app/bootstrap.php.cache on line 1958
I googled it, and the suggestion is to run cache:clear which obviously creates a catch22 situation for me. The other suggestion I found was to do composer update or composer install, which doesn't work either due to this little fella:
This thread (https://github.com/composer/composer/issues/9402) suggests to use a different version of sensio distribution bundle, for instance 3.0.36 is supposed to work with symfony 2.3.
I also had to downgrade composer to 2.2 in order to install according to these packages (otherwise some eventDispatcher or other was not compatible). After composer has gone it's course, though, I still end up with the initial parameterBag error at the top.
Is there a way of fixing this? Not permanently, the aim is to move through deprecations one by one, but in order to do that I would need to get the app up and running in it's "old self" =)
I also tried these suggestions (Symfony missing bootstrap.php.cache). Manually running the script to generate the bootstrap file doesn't help, and removing the bootstrap file and commenting it out in app.php and app_dev.php certainly doesn't help, then it just goes on to complain about
Fatal error: Uncaught Error: Class "Symfony\Component\HttpKernel\Kernel" not found in... So I assume that comment was aimed at a much later version of symfony.
I know that all my dependencies are extremely old, the pan is to get it up and running, and start updating/migrating one step at a time.
{ "name": "symfony/framework-standard-edition", "license": "MIT", "type": "project", "description": "The \"Symfony Standard Edition\" distribution", "autoload": { "psr-0": { "": "src/" } }, "require": { "php": ">=5.3.3", "symfony/symfony": "2.3.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "1.2.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.3.*", "symfony/swiftmailer-bundle": "2.3.*", "symfony/monolog-bundle": "2.3.*", "sensio/distribution-bundle": "3.0.36", "sensio/framework-extra-bundle": "2.3.*", "sensio/generator-bundle": "2.3.*", "incenteev/composer-parameter-handler": "~2.0", "friendsofsymfony/user-bundle": "2.0.0-alpha1", "avalanche123/imagine-bundle": "v2.1" }, "scripts": { "post-install-cmd": [ "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" ], "post-update-cmd": [ "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" ] }, "config": { "bin-dir": "bin" }, "minimum-stability": "stable", "extra": { "symfony-app-dir": "app", "symfony-web-dir": "web", "incenteev-parameters": { "file": "app/config/parameters.yml" }, "branch-alias": { "dev-master": "2.3-dev" } } }