- Regenerates a cache file on needs
This commit is contained in:
parent
bdf38285e4
commit
653f9239b2
|
@ -3,6 +3,7 @@
|
||||||
namespace Lean;
|
namespace Lean;
|
||||||
|
|
||||||
use Composer\EventDispatcher\Event;
|
use Composer\EventDispatcher\Event;
|
||||||
|
use Kash\CacheInvalidator;
|
||||||
|
|
||||||
class Composer
|
class Composer
|
||||||
{
|
{
|
||||||
|
@ -48,6 +49,8 @@ class Composer
|
||||||
rmdir($dest);
|
rmdir($dest);
|
||||||
|
|
||||||
$event->getIO()->write("Installation completed.");
|
$event->getIO()->write("Installation completed.");
|
||||||
|
|
||||||
|
static::postUpdate($event);
|
||||||
}
|
}
|
||||||
else {
|
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()));
|
$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');
|
$path = static::createPath('var/cache/version.cache');
|
||||||
|
|
||||||
if ( file_exists($path) ) {
|
if ( is_writeable(dirname($path)) ) {
|
||||||
$event->getIO()->write("removing cache file version to force a '$path'");
|
$event->getIO()->write("regenerating cache file version to invalidate cache for path '$path'");
|
||||||
unlink($path);
|
|
||||||
|
new CacheInvalidator($path, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue