disable hooks while rebuild

This commit is contained in:
Yuri Kuznetsov
2020-07-23 11:10:57 +03:00
parent 455ef1138f
commit fbbe0e06cf
2 changed files with 36 additions and 1 deletions
+14 -1
View File
@@ -38,7 +38,6 @@ class DataManager
private $cachePath = 'data/cache';
public function __construct(Container $container)
{
$this->container = $container;
@@ -58,6 +57,8 @@ class DataManager
{
$result = $this->clearCache();
$this->disableHooks();
$this->populateConfigParameters();
$result &= $this->rebuildMetadata();
@@ -66,6 +67,8 @@ class DataManager
$this->rebuildScheduledJobs();
$this->enableHooks();
return $result;
}
@@ -228,4 +231,14 @@ class DataManager
$config->save();
}
protected function disableHooks()
{
$this->getContainer()->get('hookManager')->disable();
}
protected function enableHooks()
{
$this->getContainer()->get('hookManager')->enable();
}
}