I want to have an app in symfony 3.4, but to have symfony/dotenv in v4. The dotenv package in version 4.4.8 supports symfony/process 3.4.
But when I run composer update
, it fails and only lists 3.4.* as candidate versions. This is probably restricted by extra.symfony.require
: 3.4.* in composer.json
.
I know it works at least in some cases. I have a project in symfony 3.4 which uses symfony/http-client 4.3
. Does this only work because there is no older version?
Where can I find more information about dependency restricting by symfony/flex
?
Here are some sources I know:
- https://symfonycasts.com/screencast/symfony5-upgrade/version-constraints#symfony-flex-symfony-extra-require-is-a-soft-requirement
- https://github.com/symfony/flex/blob/master/README.md
- https://flex.symfony.com/
And here the clearest one:
When extra.symfony.require
is a soft requirement (text from 1.), what does this mean? Does this match to 4.?
example of composer.json
which fails to run composer require symfony/dotenv:^4.0
(created with symfony new --version=3.4
):
{
"type": "project",
"require": {
"php": "^7.0.8",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "3.4.*",
"symfony/dotenv": "3.4.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "3.4.*",
"symfony/yaml": "3.4.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "3.4.*"
}
}
}