[rendertime] Timing problem during addon config read

This commit is contained in:
Philipp Holzer 2019-02-23 01:24:08 +01:00
parent 2d91d5c3d9
commit 3aae84edd1
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
2 changed files with 19 additions and 2 deletions

View file

@ -358,10 +358,15 @@ class App
$this->getMode()->determine($this->basePath); $this->getMode()->determine($this->basePath);
if ($this->getMode()->has(App\Mode::DBAVAILABLE)) { if ($this->getMode()->has(App\Mode::DBAVAILABLE)) {
Core\Hook::loadHooks();
$loader = new ConfigCacheLoader($this->basePath); $loader = new ConfigCacheLoader($this->basePath);
Core\Hook::callAll('load_config', $loader);
$this->config->getCache()->load($loader->loadCoreConfig('addon'), true); $this->config->getCache()->load($loader->loadCoreConfig('addon'), true);
$this->profiler->update(
$this->config->get('system', 'profiler', false),
$this->config->get('rendertime', 'callstack', false));
Core\Hook::loadHooks();
Core\Hook::callAll('load_config', $loader);
} }
$this->loadDefaultTimezone(); $this->loadDefaultTimezone();

View file

@ -42,6 +42,18 @@ class Profiler implements ContainerInterface
return $this->rendertime; return $this->rendertime;
} }
/**
* Updates the enabling of the current profiler
*
* @param bool $enabled
* @param bool $renderTime
*/
public function update($enabled = false, $renderTime = false)
{
$this->enabled = $enabled;
$this->rendertime = $renderTime;
}
/** /**
* @param bool $enabled True, if the Profiler is enabled * @param bool $enabled True, if the Profiler is enabled
* @param bool $renderTime True, if the Profiler should measure the whole rendertime including functions * @param bool $renderTime True, if the Profiler should measure the whole rendertime including functions