1
0
Fork 0

Use strtr instead of str_replace

pull/1456/merge
Jordi Boggiano 2013-02-15 12:54:33 +01:00
parent 79163023fc
commit c55c9e4e8d
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class Factory
$cacheDir = getenv('COMPOSER_CACHE_DIR');
if (!$home) {
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
$home = str_replace('\\', '/', getenv('APPDATA')) . '/Composer';
$home = strtr(getenv('APPDATA'), '\\', '/') . '/Composer';
} else {
$home = rtrim(getenv('HOME'), '/') . '/.composer';
}
@ -52,7 +52,7 @@ class Factory
} else {
$cacheDir = getenv('APPDATA') . '/Composer/cache';
}
$cacheDir = str_replace('\\', '/', $cacheDir);
$cacheDir = strtr($cacheDir, '\\', '/');
} else {
$cacheDir = $home.'/cache';
}