Przeglądaj źródła

Finalize new autoloader-suffix config value, refs #2524, fixes #1413

Jordi Boggiano 11 lat temu
rodzic
commit
f85a366eb9

+ 2 - 0
doc/04-schema.md

@@ -659,6 +659,8 @@ The following options are supported:
 * **prepend-autoloader:** Defaults to `true`. If false, the composer autoloader
   will not be prepended to existing autoloaders. This is sometimes required to fix
   interoperability issues with other autoloaders.
+* **autoloader-suffix:** Defaults to `null`. String to be used as a suffix for
+  the generated Composer autoloader. When null a random one will be generated.
 * **github-domains:** Defaults to `["github.com"]`. A list of domains to use in
   github mode. This is used for GitHub Enterprise setups.
 * **notify-on-install:** Defaults to `true`. Composer allows repositories to

+ 1 - 1
res/composer-schema.json

@@ -178,7 +178,7 @@
                 },
                 "autoloader-suffix": {
                     "type": "string",
-                    "description": "Optional string to be used as a suffix to the autoloader generator. When null a random one will be generated."
+                    "description": "Optional string to be used as a suffix for the generated Composer autoloader. When null a random one will be generated."
                 },
                 "prepend-autoloader": {
                     "type": "boolean",

+ 4 - 8
src/Composer/Command/ConfigCommand.php

@@ -254,18 +254,12 @@ EOT
         // handle config values
         $uniqueConfigValues = array(
             'process-timeout' => array('is_numeric', 'intval'),
-            'use-include-path' => array(
-                $booleanValidator,
-                $booleanNormalizer
-            ),
+            'use-include-path' => array($booleanValidator, $booleanNormalizer),
             'preferred-install' => array(
                 function ($val) { return in_array($val, array('auto', 'source', 'dist'), true); },
                 function ($val) { return $val; }
             ),
-            'notify-on-install' => array(
-                $booleanValidator,
-                $booleanNormalizer
-            ),
+            'notify-on-install' => array($booleanValidator, $booleanNormalizer),
             'vendor-dir' => array('is_string', function ($val) { return $val; }),
             'bin-dir' => array('is_string', function ($val) { return $val; }),
             'cache-dir' => array('is_string', function ($val) { return $val; }),
@@ -288,6 +282,8 @@ EOT
                     return $val !== 'false' && (bool) $val;
                 }
             ),
+            'autoloader-suffix' => array('is_string', function ($val) { return $val === 'null' ? null : $val; }),
+            'prepend-autoloader' => array($booleanValidator, $booleanNormalizer),
         );
         $multiConfigValues = array(
             'github-protocols' => array(

+ 1 - 1
src/Composer/Config.php

@@ -35,7 +35,7 @@ class Config
         'cache-files-ttl' => null, // fallback to cache-ttl
         'cache-files-maxsize' => '300MiB',
         'discard-changes' => false,
-        'autoload-suffix' => null,
+        'autoloader-suffix' => null,
         'prepend-autoloader' => true,
         'github-domains' => array('github.com'),
     );