Update clear cache command to be more verbose
parent
be5eae5852
commit
957f498419
|
@ -42,28 +42,28 @@ EOT
|
||||||
$io = $this->getIO();
|
$io = $this->getIO();
|
||||||
|
|
||||||
$cachePaths = array(
|
$cachePaths = array(
|
||||||
$config->get('cache-dir'),
|
'cache-dir' => $config->get('cache-dir'),
|
||||||
$config->get('cache-files-dir'),
|
'cache-files-dir' => $config->get('cache-files-dir'),
|
||||||
$config->get('cache-repo-dir'),
|
'cache-repo-dir' => $config->get('cache-repo-dir'),
|
||||||
$config->get('cache-vcs-dir'),
|
'cache-vcs-dir' => $config->get('cache-vcs-dir'),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($cachePaths as $cachePath) {
|
foreach ($cachePaths as $key => $cachePath) {
|
||||||
$cachePath = realpath($cachePath);
|
$cachePath = realpath($cachePath);
|
||||||
if (!$cachePath) {
|
if (!$cachePath) {
|
||||||
$io->write('<info>Cache directory does not exist.</info>');
|
$io->write("<info>Cache directory does not exist ($key): $cachePath</info>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$cache = new Cache($io, $cachePath);
|
$cache = new Cache($io, $cachePath);
|
||||||
if (!$cache->isEnabled()) {
|
if (!$cache->isEnabled()) {
|
||||||
$io->write('<info>Cache is not enabled.</info>');
|
$io->write("<info>Cache is not enabled ($key): $cachePath</info>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$io->write('<info>Clearing cache in: '.$cachePath.'</info>');
|
$io->write("<info>Clearing cache ($key): $cachePath</info>");
|
||||||
$cache->gc(0, 0);
|
$cache->gc(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$io->write('<info>Cache cleared.</info>');
|
$io->write('<info>All caches cleared.</info>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue