From 565e216afb9f410d96d7e78fb22d87b1127c6502 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 13 Aug 2013 15:19:08 +0200 Subject: [PATCH] Adjust cache-dir docs, fixes #1667 --- doc/03-cli.md | 8 ++++++++ src/Composer/Factory.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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 {