]> git.mxchange.org Git - friendica.git/commitdiff
[rendertime] Timing problem during addon config read
authorPhilipp Holzer <admin@philipp.info>
Sat, 23 Feb 2019 00:24:08 +0000 (01:24 +0100)
committerPhilipp Holzer <admin@philipp.info>
Sat, 23 Feb 2019 00:24:08 +0000 (01:24 +0100)
src/App.php
src/Util/Profiler.php

index 3df285cb385a59602ff8f0fb0952a9f736a3add4..571546cbb04a63a433451ce7290d81af44e9417f 100644 (file)
@@ -358,10 +358,15 @@ class App
                $this->getMode()->determine($this->basePath);
 
                if ($this->getMode()->has(App\Mode::DBAVAILABLE)) {
-                       Core\Hook::loadHooks();
                        $loader = new ConfigCacheLoader($this->basePath);
-                       Core\Hook::callAll('load_config', $loader);
                        $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();
index c8c56337180fd04100e1f3673c994bf08efde667..fe72efce40beec2e623598e3c6efd35c050d3f54 100644 (file)
@@ -42,6 +42,18 @@ class Profiler implements ContainerInterface
                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 $renderTime        True, if the Profiler should measure the whole rendertime including functions