Symfony 2.3.6 and doctrine-fixtures-bundle? - symfony

I'm learning Symfony with a french tutorial.
I need then to install doctrine-fixtures-bundle, but here is the result of my composer.phar update : http://pastebin.com/55k3zKUQ (kind of big to shows it on stackoverflow)
It seems that the latest version of doctrine-fixtures-bundle doesn't support Symfony 2.3.6.
Am I right? How could I install doctrince fixture bundle on my symfony project?
Here's my composer.json : http://pastebin.com/CpccRyid

You problem isn't the doctrine fixtures bundle, another package (jms/di-extra-bundle) is complaining about the versions.
You should always skip a lot stuff from the composer error, the first thing you should read is:
jms/di-extra-bundle 1.1.0 requires symfony/framework-bundle 2.1.*
Here you see that the jms/di-extra-bundle version 1.1.0 package symfony/framework-bundle version 2.1.* required (in other words, it requires symfony 2.1). You have installed symfony 2.3.x.
Then you read further:
jms/di-extra-bundle 1.1.1 requires symfony/finder 2.1.*
So if we take version 1.1.1, it doesn't require symfony/framework-bundle 2.1, but symfony/finder 2.1.*. The result is the same: We should install symfony 2.1 and not 2.3.
Then you go to the package page to see if there is a version which supports symfony 2.3. And yes, for the latest stable version (1.4.0) the list of dependencies looks like:
jms/aop-bundle: >=1.0.0,<1.2-dev
jms/metadata: 1.*
symfony/framework-bundle: ~2.1
symfony/process: ~2.1
symfony/finder: ~2.1
~2.1 means at least 2.1.0. It will match each 2.* version, so 2.3 is supported to. So, you just need to replace 1.1.* in your composer.json for the jms/di-extra-bundle to 1.4.* and then update the packages with the update command.

Related

Cant install sonata admin with symfony 5

$ composer require sonata-project/admin-bundle
Using version ^3.87 for sonata-project/admin-bundle
./composer.json has been updated
Running composer update sonata-project/admin-bundle
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "5.2.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- sonata-project/admin-bundle[3.87.0, ..., 3.x-dev] require symfony/console ^4.4 -> found symfony/console[v4.4.0-BETA1, ..., 4.4.x-dev] but it conflicts with your root composer.json require (5.2.*).
- Root composer.json requires sonata-project/admin-bundle ^3.87 -> satisfiable by sonata-project/admin-bundle[3.87.0, 3.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
My suggestion is to use EasyAdmin bundle which is compatible with Symfony 5.3. It has only one bug which is related to viewing images thumbnail in easyadmin panel. For now the only solution is to use TextareaField instead of ImageField in DasboardCrudController.
According to an issue from their tracker and packagist.org, the most recent version of that package (which is 3.87.0) is not fully compatible with Symfony 5. You either need to wait until this is resolved, or downgrade Symfony in your application to v4.4

How to check if libraries are unused in Symfony?

I have a lot of libraries listed in my package.json and I know that most of them are unused. How could I know the ones I use and the other one I do not use ?
I am using Symfony 3.4 and Yarn as Dependency Manager
Thanks !
If you want to know why a packages is installed, you can run the command why. As example, see this list:
>composer show
doctrine/instantiator 1.0.5 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
phpdocumentor/reflection-common 1.0.1 Common reflection classes used by
.....
input/output with nice error messages.
See the instantiator package
>composer why doctrine/instantiator
phpspec/prophecy 1.8.0 requires doctrine/instantiator (^1.0.2)
phpunit/phpunit-mock-objects 2.3.8 requires doctrine/instantiator (^1.0.2)
You can also try the tree version:
>composer why -t doctrine/instantiator
doctrine/instantiator 1.0.5 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
├──phpspec/prophecy 1.8.0 (requires doctrine/instantiator ^1.0.2)
│ └──phpunit/phpunit 4.8.36 (requires phpspec/prophecy ^1.3.1)
│ └──XXXXXXXX dev-master (requires (for development) phpunit/phpunit ~4.6)
└──phpunit/phpunit-mock-objects 2.3.8 (requires doctrine/instantiator ^1.0.2)
└──phpunit/phpunit 4.8.36 (requires phpunit/phpunit-mock-objects ~2.3)
└──XXXXXXXX dev-master (requires (for development) phpunit/phpunit ~4.6)
In Symfony front-end and back-end dependencies are kept separately by two different systems. Therefore, unused dependencies are able to be detected with two different tools. The following tools are just an example as more tools with the same functionality exist.
Front-end: package.json
https://yarnpkg.com/package/depcheck for yarn
https://www.npmjs.com/package/npm-check for npm
Back-end: composer.json
https://github.com/composer-unused/composer-unused

Composer ignore minimum stable

I get following error on composer install for ebay bundle. dependency has old version of jms and I'm using new version. what can I do on this?
How can I ignore dependency?
- webconsul/ebay-api-bundle dev-master requires jms/serializer-bundle ~0.13 -> no matching package found.
my composer.json:
"jms/serializer-bundle": "^1.1",
...
"webconsul/ebay-api-bundle": "dev-master"
There is a reason why jms/serializer-bundle had a major release. They are simply incompatible. You can't ignore the version, because the code won't work anymore.
Either contribute the update to webconsul/ebay-api-bundle or create a working fork if it's not maintained anymore.
You cannot ignore version restriction required by a dependency that you are trying to install.
The classic way in this case is to look for a more recent version of the requested package (here webconsul/ebay-api-bundle).
But, you are using dev-master and it should be the most recent dev version.
You can just wait for a new version or adapt your jms/serializer-bundle version according to the webconsul/ebay-api-bundle requirement.
EDIT By using dev-master or #dev you will have a non stable release.

couldn't install sonata admin bundle

while installing admin bundle through this error :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- sonata-project/admin-bundle 2.3.7 requires sensio/generator-bundle ~2.3 -> no matching package found.
- sonata-project/admin-bundle 2.3.6 requires sensio/generator-bundle ~2.3 -> no matching package found.
- sonata-project/admin-bundle 2.3.5 requires sensio/generator-bundle ~2.3 -> no matching package found.
- sonata-project/admin-bundle 2.3.4 requires sensio/generator-bundle ~2.3 -> no matching package found.
- sonata-project/admin-bundle 2.3.3 requires sensio/generator-bundle ~2.3 -> no matching package found.
- sonata-project/admin-bundle 2.3.2 requires sensio/generator-bundle ~2.3 -> no matching package found.
- sonata-project/admin-bundle 2.3.1 requires sensio/generator-bundle ~2.3 -> no matching package found.
- sonata-project/admin-bundle 2.3.0 requires sensio/generator-bundle ~2.3 -> no matching package found.
- Installation request for sonata-project/admin-bundle ^2.3 -> satisfiable by sonata-project/admin-bundle[2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7].
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 <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
however I have installed sensio/generator-bundle
what is the problem ? and how I can fix that ?
my symfony is 3.0.1
I've recently encountered this kind of issue during an installation of sonata/admin-bundle.
You can work with the dev dependency until the issue is resolved.
Use composer require sonata-project/admin-bundle:dev-master
Maybe the installation will require an update of related packages like sonata/user-bundle, use the version required by the bundle or #dev .
Take a look of this post on github https://github.com/sonata-project/SonataAdminBundle/issues/3467 and this document about sonata project development state. https://docs.google.com/spreadsheets/d/1fSpS10nzlEj9HE-GdZ-BHcxileEzHwRIzLlNfdNtZ2k/edit#gid=0 . So if you can it's better to keep symfony 2.7 for Sonata Admin integrations, at least by the moment.
Work done by Sonata team for compatibility with Symfony3 but this work is not finish apparently.
And I don't find a 2.4 version of SonataAdminBundle in gitHub or documentation

Sonata Easy-Extends bundle won't install

I am trying to set up the Sonata User Bundle. As per the instructions I am also trying to install Sonata Easy-Extends (according to these instructions).
Unfortunately, I can't get Easy-Extends installed via composer (on Win7):
>composer require sonata-project/easy-extends-bundle
Please provide a version constraint for the sonata-project/easy-extends-bundle requirement: dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package sonata-project/easy-extends-bundle could not be found in any version, there may be a typo in the package name.
Problem 2
- Installation request for symfony/framework-standard-edition 2.5.x-dev -> satisfiable by symfony/framework-standard-edition[2.5.x-dev].
- symfony/framework-standard-edition 2.5.x-dev requires sonata-project/easy-extends-bundle 2.0 -> 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.
Installation failed, reverting ./composer.json to its original content.
I have tried various version constraints, including 2.0 as suggested in the instructions.
What am I missing?
TIA
Matt
Based on a discussion in the sonata-users Google group, I managed to install the bundle by manually adding the following to my composer.json:
...
"sonata-project/easy-extends-bundle": "dev-master",
...
Related thread in GG can be found here.

Resources