phundament / app

Dockerized Yii2 web application base
http://phundament.com
Other
310 stars 129 forks source link

composer.lock OR versions. #211

Closed sinfuljosh closed 7 years ago

sinfuljosh commented 7 years ago

Composer complains of errors regarding symphony/console.

I see the composer.lock has the following.

            "symfony/console": "~2.3|~3.0",
            "symfony/event-dispatcher": "~2.1|~3.0",
            "symfony/filesystem": "~2.1|~3.0",
            "symfony/finder": "~2.1|~3.0",
            "symfony/process": "~2.3|~3.0",
            "symfony/stopwatch": "~2.5|~3.0"

Im assuming this is supposed to be logical OR, which composer states to use double pipe ||

When I altered the .lock file replacing all | with || I was able to complete a composer update.

https://getcomposer.org/doc/articles/versions.md

schmunk42 commented 7 years ago

The file composer.lock should be handled by composer, I'd not change it maually.

Which errors do you get?

PS: Version 5 is coming ... https://github.com/dmstr/phd5-app

philippfrenzel commented 7 years ago

according to your ps - will you have a migration path for "old" projects? We have 3 productive projects - is it worth porting them?

Best nach Stuggi

schmunk42 commented 7 years ago

The basic structure is still the same, we've even created an updatable application template called planck ... but we still need to provide more docs about upgrading.

Please open an issue in phd5 or planck if you've further questions.

sinfuljosh commented 7 years ago
Created project in myapp
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for symfony/console v3.0.4 -> satisfiable by symfony/console[v3.0.4].
    - symfony/console v3.0.4 requires php >=5.5.9 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 2
    - Installation request for symfony/event-dispatcher v3.0.4 -> satisfiable by symfony/event-dispatcher[v3.0.4].
    - symfony/event-dispatcher v3.0.4 requires php >=5.5.9 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 3
    - Installation request for symfony/filesystem v3.0.4 -> satisfiable by symfony/filesystem[v3.0.4].
    - symfony/filesystem v3.0.4 requires php >=5.5.9 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 4
    - Installation request for symfony/finder v3.0.4 -> satisfiable by symfony/finder[v3.0.4].
    - symfony/finder v3.0.4 requires php >=5.5.9 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 5
    - Installation request for symfony/process v3.0.4 -> satisfiable by symfony/process[v3.0.4].
    - symfony/process v3.0.4 requires php >=5.5.9 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 6
    - Installation request for symfony/stopwatch v3.0.4 -> satisfiable by symfony/stopwatch[v3.0.4].
    - symfony/stopwatch v3.0.4 requires php >=5.5.9 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 7
    - symfony/console v3.0.4 requires php >=5.5.9 -> your PHP version (5.4.16) does not satisfy that requirement.
    - fabpot/php-cs-fixer v1.11.2 requires symfony/console ~2.3|~3.0 -> satisfiable by symfony/console[v3.0.4].
    - Installation request for fabpot/php-cs-fixer v1.11.2 -> satisfiable by fabpot/php-cs-fixer[v1.11.2].

I am aware of the requirements of 5.5 listed, I am currently locked in this due to inept VM Admins that cannot understand things like RH's Software Collections(ಠ_ಠ).

I was hoping that since your framework appears to be Yii2 whose requirements are still at 5.4, and that your lock file does list dual versions using the || operator. That this could still be implimented.

This all seems to be centered around the symphony packages and I have not yet had ther time to look into the code being used and its compatibility.

I can confirm the by adding the changing | to || per the composer docs this resolves the above error and allows it to be installed. I did have some issue with the with the initial setup afterwards but I was stuck on multi projects and have not had a second chance to sit down and verify if there are truly dependency issues due to attempting to use the alternate version of synphonyt listed in the lock files.

As a comparison. Yii2 shows the following requirements for symphony

schmunk42 commented 7 years ago

Looks like this is coming from fabpot/php-cs-fixer, which is required by dmstr/yii2-cms-dev-metapackage.

> composer why -r fabpot/php-cs-fixer
phundament/app                  dev-feature/update-base-image  requires (for development)  dmstr/yii2-cms-dev-metapackage (^1.1.0)  
dmstr/yii2-cms-dev-metapackage  1.1.0                          requires                    fabpot/php-cs-fixer (1.* | 2.*) 

So just remove the dev-metapackage and include the packages you need manually.

A hack might be to use something like "provides": "php:5.4" in composer.json - don't know if this would really work with a system constraint.

[edit]

Leaving out php-cs-fixer does not break any runtime code. It's a dev tool. Additional note: You can use it during code-generation of the very latest giiant version, but you need to enable it manually.

sinfuljosh commented 7 years ago

It should also be noted that fabpot/php-cs-fixer has been abandoned and its recomended switching over to friendsofphp/php-cs-fixer

https://packagist.org/packages/fabpot/php-cs-fixer

From the looks of the version on that, it looks like the version requirements is only 5.3.6, (It also shows the double pipe || character in the version requirements listed.

This might be an overall fix by migrating from fabpot to friendsofphp.

schmunk42 commented 7 years ago

fixed in 4.4.0-rc1