Symfony - upgrading an old project (v 2.6) to 3.4 - php

I have a Symfony web app that needs to be upgraded from Symfony 2.6 to 3.4. Is there a standardized, bare bones composer.json that shows what's necessary for the current version? The demo app's file on github seems to be filled with a bunch of extra things that I'm not entirely sure I need. Ideally, I'd like to update the existing composer.json and put out backwards compatibility fires where they may pop up.
EDIT: my current composer is -
{
"license": "Private",
"type": "project",
"description": "Home/e-commerce site",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "2.6.*",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~3.0",
"sensio/framework-extra-bundle": "~3.0",
"incenteev/composer-parameter-handler": "~2.0",
"jms/security-extra-bundle": "dev-master",
"jms/di-extra-bundle": "dev-master",
"friendsofsymfony/user-bundle": "2.0.*#dev",
"roave/security-advisories": "dev-master"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml",
"keep-outdated": true
},
"branch-alias": {
"dev-master": "2.6-dev"
}
}
}

Try running composer create-project symfony/framework-standard-edition - it will set up a bare bones project with the default composer.json. Here's what that looks like:
{
"name": "name",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.3.*",
"twig/twig": "^1.0||^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"symfony-scripts": [
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"#symfony-scripts"
],
"post-update-cmd": [
"#symfony-scripts"
]
},
"config": {
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": null
}
}
Symfony's upgrade guide contains useful information on the deprecations you may encounter.

That is not so easy. So first you can setup a new project with the symfony installer.
symfony new my_project
in the example project you have the actual composer.json you can use that version. Next step is to look at all your extensions if they are the latest version. Next step is to at the upgrade guides what have changed and change all that new things and from 2.6 to 3.3 there is a lot of stuf that have changed. You can find the upgrade instructions in the repository.
https://github.com/symfony/symfony/blob/master/UPGRADE-3.0.md
for example. You have to fix all problems and change your code until it's working again.

Unless you really need to go for 3.* (PHP 7 or other reasons for which you can not choose the version), you can update to the LTS version instead:
Symfony roadmap
Currently, 2.8.22 is a long term support version. This means you need only to update from 2.6 to 2.8 and you'll be fine for some time (security and documentation wise).
For specific details you can use the version checker on the page above. It shows that 3.4 is supported for 2 years longer than 2.8, but the LTS is also perfectly fine.
Consider your specific case IF going smaller steps may be a better choice. Most changes from 2.6 to 2.8 are necessary to get to 3.4, anyways.
2.8:
Nov 2018: End of support for bug fixes
Nov 2019: End of support for security fixes
3.4:
Nov 2020: End of support for bug fixes
Nov 2021: End of support for security fixes

Related

Undefined class constant 'IGNORE_ON_UNINITIALIZED_REFERENCE' when updating from 3.3 to 3.4

I am currently trying to update a Symfony 3.3 to the latest Symfony 3.4 (will port it to Symfony 4 before support runs out, no time to rewrite the system though) and PHP 7. Since PHP 7.3 seems to not work that great with 3.4 I decided to stay on PHP 7.2 for now.
I updated the composer.json, ran composer install (and update with dependencies) and clearned the cache. However, after everything worked flawlessly within composer, I tried to access the system where I am greeted by the following message:
Fatal error: Uncaught Error: Undefined class constant
'IGNORE_ON_UNINITIALIZED_REFERENCE' in
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass.php:93
Stack trace: #0
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\Compiler.php(141):
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#1 E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php(788):
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#2 E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php(637):
Symfony\Component\DependencyInjection\ContainerBuilder->compile() #3
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php
in
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass.php
on line 93
Any thought how I could fix that? I am sure I have a wrong package installed or something.
Here's the composer.json for reference:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.4.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "^3.1",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"faceleg/html5lib-php": "dev-master",
"smalot/pdfparser": "*",
"seostats/seostats": "dev-master",
"nategood/httpful": "*",
"twbs/bootstrap": "*",
"friendsofsymfony/user-bundle": "2.0.*",
"phpoffice/phpspreadsheet": "^1.1",
"ext-json": "*"
},
"require-dev": {
"sensio/generator-bundle": "^3.0"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-var-dir": "var",
"symfony-bin-dir": "bin",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.5-dev"
}
}
}
I was able to fix this issue with the help of the Symfony Devs Slack group. It turned out that the constant was indeed set, however due to some faulty cache it wasn't included in the runtime.
To fix this issue, I had to manually remove the cache/prod and cache/dev folders instead of using the bin/console cache:clear command.

Vendor updates broke FOS User Bundle with "Call to a member function has() on a non-object"

I updated my vendors for a Symfony 2.8 project and suddenly the login page isn't loading – instead I get this:
Error: Call to a member function has() on a non-object in
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
at line 184
"name": "hazardlog",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.11.1",
"dist": {
"url": "https://code.jquery.com/jquery-1.11.1.js",
"type": "file"
}
}
}
],
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"braincrafted/bootstrap-bundle": "~2.0",
"twbs/bootstrap": "3.0.*",
"jquery/jquery": "1.11.*",
"hwi/oauth-bundle": "^0.5.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"stephanecollot/datetimepicker-bundle": "dev-master"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7"
},
"scripts": {
"symfony-scripts": [
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"#symfony-scripts"
],
"post-update-cmd": [
"#symfony-scripts"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
I have seen this sort of question several times but I could not find one with an accepted answer and explanation. So here goes.
The basic problem lies with:
"friendsofsymfony/user-bundle": "~2.0#dev",
Back when Symfony 2.8/3.0 was first released, the stable 1.x version of FOSUserBundle no longer worked. The 2.x version has been in development for years with no actual road map in sight for when it would be stabilized. So the development branch was hacked up to get it working. And folks had no choice but to use it which of course is dangerous because you never know when a development change might in fact break your code.
Time went by and eventually a stable 2.x version of the FOSUserBundle was released. However, quite a few developers never got around to updating their dependencies and continued to use the master branch.
Fast forward to the present. The release of Symfony 4 has now triggered a fair amount of development in the master branch. Development which is introducing breaking changes to existing 2.8 (and probably 3.0) code.
The bottom line is to use a stable branch with:
"friendsofsymfony/user-bundle": "~2.0",
followed by a composer update.
For those using Symfony 3.2, it looks like version "~2.1" throws same error along with the OP's version "~2.0#dev".
This worked:
"friendsofsymfony/user-bundle": "2.0"
Keeping it at 2.0 did the trick for me.
had a problem like this here but solved,i just did the opposite of this.
i had:
"friendsofsymfony/user-bundle": "^2.1",
in my composer.json file which give me a Call to a member function has() on null error to solve this i Actually add "#dev it became:
"friendsofsymfony/user-bundle": "^2.1#dev",
then updated my composer with :
composer update

Symfony2, getting error on running composer update

Composer.json
{
"name": "go-get-me",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"sylius/flow-bundle": "^0.15.0",
"hwi/oauth-bundle": "^0.4.1",
"stripe/stripe-php": "^3.14",
"misd/phone-number-bundle": "^1.1",
"twig/extensions": "^1.3",
"php-http/guzzle6-adapter": "^1",
"payum/payum-bundle": "^2.1#dev",
"payum/paypal-express-checkout-nvp": "^1.3.3",
"pimax/fb-messenger-php": "dev-master",
"twilio/sdk": "^4.10",
"vresh/twilio-bundle": "^1.0",
"infusionsoft/php-sdk": "^1.2",
"hayageek/oauth2-yahoo": "^2.0",
"glifery/entity-hidden-type-bundle": "^1.2"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7",
"doctrine/doctrine-fixtures-bundle": "^2.3",
"faisalman/simple-excel-php" : "0.3.*"
},
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.5.9"
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
}
I am a newbie in symfony2. Here I am updating the required dependencies, Its shows an error, I am confused, do I need to take the clone of payum bundle or not? if yes then what must be the path? As My current path is /e/xampp/htdocs/nitu.dhaka/2016/subscription.
1/ Your problem one is that you required development a version of your libraries.
"payum/payum-bundle": "^2.1#dev",
You can lower your minimum-stability to dev, but you can have some unexpected behaviour since you will potentially accept to install some unstable versions of all packages. If you want still process add this line to your composer.json
"minimum-stability": "stable",
Please refer to https://getcomposer.org/doc/04-schema.md#minimum-stability for more information.
However, my advice is to use a non dev version of your packages, for example:
"payum/payum-bundle": "^2.1#dev",
could become
"payum/payum-bundle": "~2.1",
2/ A library of php is missing for some of your packages requires ext-intl *. In order to install it, please refer to https://stackoverflow.com/a/26308767/2377164
Ohh Finally Installation started, Following changed I have done:-
1. Configured ext-intl package by uncomment it from php.ini, that is in xampp/php/
2.And very important replace
payum/payum-bundle": "^2.1#dev", to "payum/payum-bundle": "^2.0",
"payum/paypal-express-checkout-nvp": "^1.3",
I thing there is a combination for
"payum/payum-bundle": "^2.0",
"payum/paypal-express-checkout-nvp": "^1.3",
This worked for me.
Thanks.

Symfony2 Sonata EcommerceBundle failing to install from composer

I have a new project and I want to try out sonata Ecommerce bundle. I removed all the vendors to do a clean composer install, but when I do php composer.phar install I get this error:
$ php composer.phar install
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "composer.phar self-update" to get the latest version.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/framework-standard-edition 2.6.x-dev -> satisfiable by symfony/framework-standard-edition[2.6.x-dev].
- symfony/framework-standard-edition 2.6.x-dev requires sonata-project/ecommerce 2.3-dev -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
This is my composer.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~3.0.12",
"sensio/framework-extra-bundle": "~3.0",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~1.3",
"sonata-project/core-bundle": "dev-master",
"sonata-project/ecommerce": "2.3#dev",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"sonata-project/easy-extends-bundle": "dev-master",
"sonata-project/user-bundle": "dev-master",
"sonata-project/datagrid-bundle": "dev-master",
"knplabs/knp-menu": "2.*",
"sonata-project/classification-bundle": "dev-master",
"jms/serializer-bundle": "~0.11",
"sonata-project/media-bundle": "dev-master",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"ddeboer/data-import-bundle": "dev-master",
"braincrafted/bootstrap-bundle": "dev-master",
"twitter/bootstrap": "3.3.*",
"symfony/property-access": "~2.6",
"knplabs/knp-paginator-bundle": "~2.4",
"sonata-project/translation-bundle": "~1.0"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.6-dev"
}
}
}
Even if I do
"require": {
"sonata-project/ecommerce": "2.3#dev",
},
I get the same problem... I tried, both, 2.3#dev and dev-master. It didnt help. But without this ecommerce require the composer installs without any errors.. What is wrong here?
I was able to install the dependencies by starting from a new composer.json file:
$ composer create-project symfony/framework-standard-edition "2.6" "2.6.*" --no-interaction -v
I added the "sonata-project/ecommerce": "dev-master" dependency and "minimum-stability": "dev" to the composer.json file. Then composer update worked perfectly.
Then I started adding the dependencies from your question but it failed with all the dependencies, so I think there is a compatibility problem between packages.
Here is the full composer.json file:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.*",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"doctrine/dbal": "<2.5",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"sonata-project/ecommerce": "dev-master",
"friendsofsymfony/user-bundle": "~1.3"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"minimum-stability": "dev"
}
Edit: I was able to install the dependencies from the composer.json file from the question by:
remove the sonata-project and "knplabs/knp-menu": "2.*", requirements
add "sonata-project/ecommerce": "dev-master",
add "minimum-stability": "dev"

Error: Undefined class constant 'END_OF_MAINTENANCE' Symfony 2

I'm developing the functions of an existing project.
The project is developed using Symfony 2. And I created a virtual host Apache (Ubuntu and LAMP) to turn it. When the boot gives me this error.
"FatalErrorException in ConfigDataCollector.php line 276: Error: Undefined class constant 'END_OF_MAINTENANCE'". I can not update the composer because if I would do when I would do after "git push" to the master should also load the new libraries (packages) and does not need it because the site run well with this version of the composer.
Then another thing:
it is normal that when I delete brutally cache symfony to understand (/ project / app / cache), when after loading the page of my project, Apache is to write with your permissions on the folder so I can not do php app / console cache: clear. I wanted to know if it is a problem that affects the other or not.
One other thing the same thing that happens to / project / app / cache happens with / project / app / logs.
I am attaching the composer.
{
"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.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"facebook/php-sdk": "3.2.0",
"friendsofsymfony/facebook-bundle": "dev-master",
"friendsofsymfony/jsrouting-bundle": "#stable",
"mattketmo/email-checker": "~1.0",
"hwi/oauth-bundle": "0.4.*#dev",
"suncat/mobile-detect-bundle": "0.10.*"
},
"require-dev": {
"phpdocumentor/phpdocumentor": "2.*"
},
"scripts": {
"post-install-cmd": [
"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.4-dev"
}
}
}
Thanks a lot

Categories