From 900bed1c32239ebc2e08143ccdcebee9394038dc Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 13 Sep 2011 02:23:52 +0200 Subject: [PATCH] Normalize package names --- src/Composer/Command/InstallCommand.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Composer/Command/InstallCommand.php b/src/Composer/Command/InstallCommand.php index add683faf..e92994a46 100644 --- a/src/Composer/Command/InstallCommand.php +++ b/src/Composer/Command/InstallCommand.php @@ -65,6 +65,7 @@ class InstallCommand // TODO there should be an update flag or dedicated update command // TODO check lock file to remove packages that disappeared from the requirements foreach ($config['require'] as $name => $version) { + $name = $this->lowercase($name); if ('latest' === $version) { $request->install($name); } else { @@ -157,4 +158,12 @@ class InstallCommand file_put_contents('composer.lock', json_encode($content, JSON_FORCE_OBJECT)."\n"); echo '> composer.lock dumped'.PHP_EOL; } + + protected function lowercase($str) + { + if (function_exists('mb_strtolower')) { + return mb_strtolower($str, 'UTF-8'); + } + return strtolower($str, 'UTF-8'); + } } \ No newline at end of file