module clear cache

This commit is contained in:
Yuri Kuznetsov
2021-08-06 13:36:38 +03:00
parent 58ffd93961
commit 837ad89502
3 changed files with 14 additions and 5 deletions

View File

@@ -117,6 +117,8 @@ class DataManager
*/
public function clearCache(): void
{
$this->module->clearCache();
$result = $this->fileManager->removeInDir($this->cachePath);
if ($result != true) {

View File

@@ -199,10 +199,6 @@ class Unifier
*/
private function getModuleList(): array
{
if (!isset($this->moduleList)) {
$this->moduleList = $this->module->getOrderedList();
}
return $this->moduleList;
return $this->module->getOrderedList();
}
}

View File

@@ -188,6 +188,17 @@ class Module
return $this->list;
}
/**
* @todo Use event-dispatcher class (passed via constructor).
* `$this->clearCacheEventDispatcher->subscribe( ... );`
*/
public function clearCache(): void
{
$this->data = null;
$this->list = null;
$this->internalList = null;
}
private function loadData(): array
{
$data = [];