Closed ostark closed 6 years ago
We added it because a lot of people were getting errors due to running the same composer.lock in different environments with different PHP versions. For example they might run composer update
locally where they're running PHP 7.2, and then deploy to a production server that's running PHP 7.0; which would result in syntax errors because composer.lock
was set to use dependencies that take advantage of PHP 7.1 / 7.2 syntax. Forcing Composer to only install dependencies that are compatible with 7.0 helps avoid this issue.
You should reconsider this. EOL of PHP 7.0 is less than 6 months ahead. More dependencies require ^7.1 these days, Yii2.1 (soon) as well.
Btw, all of your hosting partners run PHP 7.1 or 7.2 by default.
That line doesn’t prevent Craft from being run on PHP 7.1+. We’re going to keep it until a version of Craft comes out that requires a newer version of PHP. It’s easy enough to delete if you don’t want it (or just don’t include it in a fork of this repo).
Okay :100:
Maybe it is usefull for people to understand why you are doing this and how to solve it:
composer config platform --unset
@ostark uh composer config platform --unset
thanks!! :)
I noticed the tests in travis cover 7.1-7.3. Maybe, almost 2 years later it's time to reconsider this?
We will change it when Craft’s PHP requirements change, which we expect will be for Craft 4, unless Yii forces our hand before then (I know they are at least considering it, due to Travis).
The "fake php version 7.0" prevents depencencies with other/higher requirements, e.g.
php: "^7.1"
, even if the higher version is installed.https://github.com/fortrabbit/craft-copy/blob/ad6c2204a01f05031df4f417ae78aeeb7403b09f/composer.json#L24-L26
Instead of
config/platfrom/php: "7.0"
we should userequire/php: "^7.0"
.