1
0
Fork 0

Added sort-packages into config

pull/4716/head
hanov.ruslan 2015-12-18 23:13:36 +03:00
parent c9501a4cc1
commit b298b9e8c6
3 changed files with 3 additions and 1 deletions

View File

@ -322,6 +322,7 @@ EOT
}, },
), ),
'autoloader-suffix' => array('is_string', function ($val) { return $val === 'null' ? null : $val; }), 'autoloader-suffix' => array('is_string', function ($val) { return $val === 'null' ? null : $val; }),
'sort-packages' => array($booleanValidator, $booleanNormalizer),
'optimize-autoloader' => array($booleanValidator, $booleanNormalizer), 'optimize-autoloader' => array($booleanValidator, $booleanNormalizer),
'classmap-authoritative' => array($booleanValidator, $booleanNormalizer), 'classmap-authoritative' => array($booleanValidator, $booleanNormalizer),
'prepend-autoloader' => array($booleanValidator, $booleanNormalizer), 'prepend-autoloader' => array($booleanValidator, $booleanNormalizer),

View File

@ -117,7 +117,7 @@ EOT
$versionParser->parseConstraints($constraint); $versionParser->parseConstraints($constraint);
} }
$sortPackages = $input->getOption('sort-packages'); $sortPackages = $input->getOption('sort-packages') || $composer->getConfig()->get('sort-packages');
if (!$this->updateFileCleanly($json, $baseRequirements, $requirements, $requireKey, $removeKey, $sortPackages)) { if (!$this->updateFileCleanly($json, $baseRequirements, $requirements, $requireKey, $removeKey, $sortPackages)) {
foreach ($requirements as $package => $version) { foreach ($requirements as $package => $version) {

View File

@ -39,6 +39,7 @@ class Config
'bin-compat' => 'auto', 'bin-compat' => 'auto',
'discard-changes' => false, 'discard-changes' => false,
'autoloader-suffix' => null, 'autoloader-suffix' => null,
'sort-packages' => false,
'optimize-autoloader' => false, 'optimize-autoloader' => false,
'classmap-authoritative' => false, 'classmap-authoritative' => false,
'prepend-autoloader' => true, 'prepend-autoloader' => true,