Use strtr instead of str_replace
parent
79163023fc
commit
c55c9e4e8d
|
@ -40,7 +40,7 @@ class Factory
|
||||||
$cacheDir = getenv('COMPOSER_CACHE_DIR');
|
$cacheDir = getenv('COMPOSER_CACHE_DIR');
|
||||||
if (!$home) {
|
if (!$home) {
|
||||||
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
||||||
$home = str_replace('\\', '/', getenv('APPDATA')) . '/Composer';
|
$home = strtr(getenv('APPDATA'), '\\', '/') . '/Composer';
|
||||||
} else {
|
} else {
|
||||||
$home = rtrim(getenv('HOME'), '/') . '/.composer';
|
$home = rtrim(getenv('HOME'), '/') . '/.composer';
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class Factory
|
||||||
} else {
|
} else {
|
||||||
$cacheDir = getenv('APPDATA') . '/Composer/cache';
|
$cacheDir = getenv('APPDATA') . '/Composer/cache';
|
||||||
}
|
}
|
||||||
$cacheDir = str_replace('\\', '/', $cacheDir);
|
$cacheDir = strtr($cacheDir, '\\', '/');
|
||||||
} else {
|
} else {
|
||||||
$cacheDir = $home.'/cache';
|
$cacheDir = $home.'/cache';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue