Add COMPOSER_MEMORY_LIMIT env var to force a given memory_limit, fixes #6931
parent
5cd0fef7ff
commit
882b82d542
|
@ -45,6 +45,10 @@ if (function_exists('ini_set')) {
|
|||
if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1536) {
|
||||
@ini_set('memory_limit', '1536M');
|
||||
}
|
||||
// Set user defined memory limit
|
||||
if ($memoryLimit = getenv('COMPOSER_MEMORY_LIMIT')) {
|
||||
@ini_set('memory_limit', $memoryLimit);
|
||||
}
|
||||
unset($memoryInBytes, $memoryLimit);
|
||||
}
|
||||
|
||||
|
|
|
@ -909,6 +909,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
|
||||
if you use Composer as super user at all times like in docker containers.
|
||||
|
||||
### COMPOSER_MEMORY_LIMIT
|
||||
|
||||
If set, the value is used as php's memory_limit.
|
||||
|
||||
### COMPOSER_MIRROR_PATH_REPOS
|
||||
|
||||
If set to 1, this env changes the default path repository strategy to `mirror` instead
|
||||
|
|
Loading…
Reference in New Issue