mirror of
https://github.com/flarum/framework.git
synced 2024-11-22 20:20:53 +08:00
clear cache files from storage/views (#2648)
Co-authored-by: Emamul Khan <emamul.khan@oxid-esales.com>
This commit is contained in:
parent
f0c6050654
commit
7fa22a131f
|
@ -10,10 +10,11 @@
|
||||||
namespace Flarum\Extend;
|
namespace Flarum\Extend;
|
||||||
|
|
||||||
use Flarum\Extension\Extension;
|
use Flarum\Extension\Extension;
|
||||||
|
use Flarum\Foundation\Paths;
|
||||||
use Illuminate\Contracts\Container\Container;
|
use Illuminate\Contracts\Container\Container;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
|
||||||
class View implements ExtenderInterface
|
class View implements ExtenderInterface, LifecycleInterface
|
||||||
{
|
{
|
||||||
private $namespaces = [];
|
private $namespaces = [];
|
||||||
|
|
||||||
|
@ -48,4 +49,26 @@ class View implements ExtenderInterface
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Container $container
|
||||||
|
* @param Extension $extension
|
||||||
|
* @throws \Illuminate\Contracts\Container\BindingResolutionException
|
||||||
|
*/
|
||||||
|
public function onEnable(Container $container, Extension $extension)
|
||||||
|
{
|
||||||
|
$storagePath = $container->make(Paths::class)->storage;
|
||||||
|
array_map('unlink', glob($storagePath.'/views/*'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Container $container
|
||||||
|
* @param Extension $extension
|
||||||
|
* @throws \Illuminate\Contracts\Container\BindingResolutionException
|
||||||
|
*/
|
||||||
|
public function onDisable(Container $container, Extension $extension)
|
||||||
|
{
|
||||||
|
$storagePath = $container->make(Paths::class)->storage;
|
||||||
|
array_map('unlink', glob($storagePath.'/views/*'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ class CacheClearCommand extends AbstractCommand
|
||||||
$storagePath = $this->paths->storage;
|
$storagePath = $this->paths->storage;
|
||||||
array_map('unlink', glob($storagePath.'/formatter/*'));
|
array_map('unlink', glob($storagePath.'/formatter/*'));
|
||||||
array_map('unlink', glob($storagePath.'/locale/*'));
|
array_map('unlink', glob($storagePath.'/locale/*'));
|
||||||
|
array_map('unlink', glob($storagePath.'/views/*'));
|
||||||
|
|
||||||
event(new ClearingCache);
|
event(new ClearingCache);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user