1
0
Fork 0

Merge remote-tracking branch 'hanovruslan/add-sort-packages-into-config'

pull/4738/head
Jordi Boggiano 2015-12-22 20:43:36 +00:00
commit 94136e0d4f
4 changed files with 7 additions and 1 deletions

View File

@ -126,6 +126,10 @@ autoloader. When null a random one will be generated.
Defaults to `false`. If `true`, always optimize when dumping the autoloader. Defaults to `false`. If `true`, always optimize when dumping the autoloader.
## sort-packages
Defaults to `false`. If `true`, Keep packages sorted in `composer.json`.
## classmap-authoritative ## classmap-authoritative
Defaults to `false`. If `true`, the Composer autoloader will only load classes Defaults to `false`. If `true`, the Composer autoloader will only load classes

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,