1
0
Fork 0

Normalize package names

pull/11/merge
Jordi Boggiano 2011-09-13 02:23:52 +02:00
parent d875f0964e
commit 900bed1c32
1 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,7 @@ class InstallCommand
// TODO there should be an update flag or dedicated update command // TODO there should be an update flag or dedicated update command
// TODO check lock file to remove packages that disappeared from the requirements // TODO check lock file to remove packages that disappeared from the requirements
foreach ($config['require'] as $name => $version) { foreach ($config['require'] as $name => $version) {
$name = $this->lowercase($name);
if ('latest' === $version) { if ('latest' === $version) {
$request->install($name); $request->install($name);
} else { } else {
@ -157,4 +158,12 @@ class InstallCommand
file_put_contents('composer.lock', json_encode($content, JSON_FORCE_OBJECT)."\n"); file_put_contents('composer.lock', json_encode($content, JSON_FORCE_OBJECT)."\n");
echo '> composer.lock dumped'.PHP_EOL; 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');
}
} }