浏览代码

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

Jordi Boggiano 11 年之前
父节点
当前提交
f85a366eb9
共有 4 个文件被更改,包括 8 次插入10 次删除
  1. 2 0
      doc/04-schema.md
  2. 1 1
      res/composer-schema.json
  3. 4 8
      src/Composer/Command/ConfigCommand.php
  4. 1 1
      src/Composer/Config.php

+ 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
 * **prepend-autoloader:** Defaults to `true`. If false, the composer autoloader
   will not be prepended to existing autoloaders. This is sometimes required to fix
   will not be prepended to existing autoloaders. This is sometimes required to fix
   interoperability issues with other autoloaders.
   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-domains:** Defaults to `["github.com"]`. A list of domains to use in
   github mode. This is used for GitHub Enterprise setups.
   github mode. This is used for GitHub Enterprise setups.
 * **notify-on-install:** Defaults to `true`. Composer allows repositories to
 * **notify-on-install:** Defaults to `true`. Composer allows repositories to

+ 1 - 1
res/composer-schema.json

@@ -178,7 +178,7 @@
                 },
                 },
                 "autoloader-suffix": {
                 "autoloader-suffix": {
                     "type": "string",
                     "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": {
                 "prepend-autoloader": {
                     "type": "boolean",
                     "type": "boolean",

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

@@ -254,18 +254,12 @@ EOT
         // handle config values
         // handle config values
         $uniqueConfigValues = array(
         $uniqueConfigValues = array(
             'process-timeout' => array('is_numeric', 'intval'),
             'process-timeout' => array('is_numeric', 'intval'),
-            'use-include-path' => array(
-                $booleanValidator,
-                $booleanNormalizer
-            ),
+            'use-include-path' => array($booleanValidator, $booleanNormalizer),
             'preferred-install' => array(
             'preferred-install' => array(
                 function ($val) { return in_array($val, array('auto', 'source', 'dist'), true); },
                 function ($val) { return in_array($val, array('auto', 'source', 'dist'), true); },
                 function ($val) { return $val; }
                 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; }),
             'vendor-dir' => array('is_string', function ($val) { return $val; }),
             'bin-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; }),
             'cache-dir' => array('is_string', function ($val) { return $val; }),
@@ -288,6 +282,8 @@ EOT
                     return $val !== 'false' && (bool) $val;
                     return $val !== 'false' && (bool) $val;
                 }
                 }
             ),
             ),
+            'autoloader-suffix' => array('is_string', function ($val) { return $val === 'null' ? null : $val; }),
+            'prepend-autoloader' => array($booleanValidator, $booleanNormalizer),
         );
         );
         $multiConfigValues = array(
         $multiConfigValues = array(
             'github-protocols' => 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-ttl' => null, // fallback to cache-ttl
         'cache-files-maxsize' => '300MiB',
         'cache-files-maxsize' => '300MiB',
         'discard-changes' => false,
         'discard-changes' => false,
-        'autoload-suffix' => null,
+        'autoloader-suffix' => null,
         'prepend-autoloader' => true,
         'prepend-autoloader' => true,
         'github-domains' => array('github.com'),
         'github-domains' => array('github.com'),
     );
     );