From f85a366eb95b634fc63cdc3916ab1ded1e336b55 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 26 Dec 2013 17:40:52 +0100 Subject: [PATCH] Finalize new autoloader-suffix config value, refs #2524, fixes #1413 --- doc/04-schema.md | 2 ++ res/composer-schema.json | 2 +- src/Composer/Command/ConfigCommand.php | 12 ++++-------- src/Composer/Config.php | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/04-schema.md b/doc/04-schema.md index 3a250a418..56e787110 100644 --- a/doc/04-schema.md +++ b/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 diff --git a/res/composer-schema.json b/res/composer-schema.json index 180656c1d..827e41f5c 100644 --- a/res/composer-schema.json +++ b/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", diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index edc370a66..629cb7fec 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/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( diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 311c7de85..c54bc498c 100644 --- a/src/Composer/Config.php +++ b/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'), );