Merge pull request #5665 from radmiraal/default-strategy-from-environment
Allow setting default transport strategy for path repositoriespull/5737/head
commit
b6cc2c7b83
|
@ -868,4 +868,10 @@ If set to 1, this env disables the warning about running commands as root/super
|
||||||
It also disables automatic clearing of sudo sessions, so you should really only set this
|
It also disables automatic clearing of sudo sessions, so you should really only set this
|
||||||
if you use Composer as super user at all times like in docker containers.
|
if you use Composer as super user at all times like in docker containers.
|
||||||
|
|
||||||
|
### COMPOSER_MIRROR_PATH_REPOS
|
||||||
|
|
||||||
|
If set to 1, this env changes the default path repository strategy to `mirror` instead
|
||||||
|
of `symlink`. As it is the default strategy being set it can still be overwritten by
|
||||||
|
repository options.
|
||||||
|
|
||||||
← [Libraries](02-libraries.md) | [Schema](04-schema.md) →
|
← [Libraries](02-libraries.md) | [Schema](04-schema.md) →
|
||||||
|
|
|
@ -59,6 +59,11 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
|
||||||
$currentStrategy = self::STRATEGY_SYMLINK;
|
$currentStrategy = self::STRATEGY_SYMLINK;
|
||||||
$allowedStrategies = array(self::STRATEGY_SYMLINK, self::STRATEGY_MIRROR);
|
$allowedStrategies = array(self::STRATEGY_SYMLINK, self::STRATEGY_MIRROR);
|
||||||
|
|
||||||
|
$mirrorPathRepos = getenv('COMPOSER_MIRROR_PATH_REPOS');
|
||||||
|
if ($mirrorPathRepos) {
|
||||||
|
$currentStrategy = self::STRATEGY_MIRROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (true === $transportOptions['symlink']) {
|
if (true === $transportOptions['symlink']) {
|
||||||
$currentStrategy = self::STRATEGY_SYMLINK;
|
$currentStrategy = self::STRATEGY_SYMLINK;
|
||||||
$allowedStrategies = array(self::STRATEGY_SYMLINK);
|
$allowedStrategies = array(self::STRATEGY_SYMLINK);
|
||||||
|
|
Loading…
Reference in New Issue