- Regenerates a cache file on needs

This commit is contained in:
Dave M. 2023-02-01 18:53:15 +00:00
parent bdf38285e4
commit 653f9239b2
1 changed files with 7 additions and 3 deletions

View File

@ -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);
}
}