Merge remote-tracking branch 'hanovruslan/add-sort-packages-into-config'
commit
94136e0d4f
|
@ -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
|
||||||
|
|
|
@ -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),
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue