1
0
Fork 0
pull/1407/head
ntoniazzi 2012-12-11 11:49:30 +01:00
parent 3a0270147a
commit 770292a42c
1 changed files with 10 additions and 2 deletions

View File

@ -42,7 +42,11 @@ class Factory
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
$home = getenv('APPDATA') . '/Composer';
} else {
$home = rtrim(getenv('HOME'), '/') . '/.composer';
$xdgConfig = getenv('XDG_CONFIG_HOME');
if (!$xdgConfig) {
$xdgConfig = rtrim(getenv('HOME'), '/') . '/.config';
}
$home = $xdgConfig . '/composer';
}
}
if (!$cacheDir) {
@ -53,7 +57,11 @@ class Factory
$cacheDir = getenv('APPDATA') . '/Composer/cache';
}
} else {
$cacheDir = $home.'/cache';
$xdgCache = getenv('XDG_CACHE_HOME');
if (!$xdgCache) {
$xdgCache = rtrim(getenv('HOME'), '/') . '/.cache';
}
$cacheDir = $xdgCache . '/composer';
}
}