- Regenerates a cache file on needs
This commit is contained in:
parent
bdf38285e4
commit
653f9239b2
|
@ -3,6 +3,7 @@
|
|||
namespace Lean;
|
||||
|
||||
use Composer\EventDispatcher\Event;
|
||||
use Kash\CacheInvalidator;
|
||||
|
||||
class Composer
|
||||
{
|
||||
|
@ -48,6 +49,8 @@ class Composer
|
|||
rmdir($dest);
|
||||
|
||||
$event->getIO()->write("Installation completed.");
|
||||
|
||||
static::postUpdate($event);
|
||||
}
|
||||
else {
|
||||
$event->getIO()->writeError(sprintf("The user you are running this script with doesn't seem to have a writable permission on directory %s", static::createPath()));
|
||||
|
@ -61,9 +64,10 @@ class Composer
|
|||
|
||||
$path = static::createPath('var/cache/version.cache');
|
||||
|
||||
if ( file_exists($path) ) {
|
||||
$event->getIO()->write("removing cache file version to force a '$path'");
|
||||
unlink($path);
|
||||
if ( is_writeable(dirname($path)) ) {
|
||||
$event->getIO()->write("regenerating cache file version to invalidate cache for path '$path'");
|
||||
|
||||
new CacheInvalidator($path, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue