diff --git a/doc/03-cli.md b/doc/03-cli.md index 88f2b335a..611fae4a2 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -461,6 +461,14 @@ This file allows you to set [configuration](04-schema.md#config) and In case global configuration matches _local_ configuration, the _local_ configuration in the project's `composer.json` always wins. +### COMPOSER_CACHE_DIR + +The `COMPOSER_CACHE_DIR` var allows you to change the composer cache directory, +which is also configurable via the [`cache-dir`](04-schema.md#config) option. + +By default it points to $COMPOSER_HOME/cache on \*nix and OSX, and +`C:\Users\\AppData\Local\Composer` (or `%LOCALAPPDATA%/Composer`) on Windows. + ### COMPOSER_PROCESS_TIMEOUT This env var controls the time composer waits for commands (such as git diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index e45c75001..441d3fd8a 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -60,7 +60,7 @@ class Factory if ($cacheDir = getenv('LOCALAPPDATA')) { $cacheDir .= '/Composer'; } else { - $cacheDir = getenv('APPDATA') . '/Composer/cache'; + $cacheDir = $home . '/cache'; } $cacheDir = strtr($cacheDir, '\\', '/'); } else {