diff --git a/src/Composer/Command/ClearCacheCommand.php b/src/Composer/Command/ClearCacheCommand.php
index f49b00bc3..cf25491d3 100644
--- a/src/Composer/Command/ClearCacheCommand.php
+++ b/src/Composer/Command/ClearCacheCommand.php
@@ -40,21 +40,30 @@ EOT
{
$config = Factory::createConfig();
$io = $this->getIO();
-
- $cachePath = realpath($config->get('cache-repo-dir'));
- if (!$cachePath) {
- $io->write('Cache directory does not exist.');
- return;
+
+ $cachePaths = array(
+ $config->get('cache-dir'),
+ $config->get('cache-files-dir'),
+ $config->get('cache-repo-dir'),
+ $config->get('cache-vcs-dir'),
+ );
+
+ foreach ($cachePaths as $cachePath) {
+ $cachePath = realpath($cachePath);
+ if (!$cachePath) {
+ $io->write('Cache directory does not exist.');
+ return;
+ }
+ $cache = new Cache($io, $cachePath);
+ if (!$cache->isEnabled()) {
+ $io->write('Cache is not enabled.');
+ return;
+ }
+
+ $io->write('Clearing cache in: '.$cachePath.'');
+ $cache->gc(0, 0);
}
- $cache = new Cache($io, $cachePath);
- if (!$cache->isEnabled()) {
- $io->write('Cache is not enabled.');
- return;
- }
-
- $io->write('Clearing cache in: '.$cachePath.'');
- $cache->gc(0, 0);
$io->write('Cache cleared.');
}
}