X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FProfiler.php;h=dc140469c671e945e42408a1b41ff5bd67fd14f9;hb=3940e804e3ee4ac921e109f62a73fac2becaa611;hp=fe72efce40beec2e623598e3c6efd35c050d3f54;hpb=c1896eee34778ae022481af56f634bd6374544d2;p=friendica.git diff --git a/src/Util/Profiler.php b/src/Util/Profiler.php index fe72efce40..dc140469c6 100644 --- a/src/Util/Profiler.php +++ b/src/Util/Profiler.php @@ -2,6 +2,8 @@ namespace Friendica\Util; +use Friendica\Core\Config\Cache\ConfigCache; +use Friendica\Core\Config\Configuration; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; @@ -45,23 +47,21 @@ class Profiler implements ContainerInterface /** * Updates the enabling of the current profiler * - * @param bool $enabled - * @param bool $renderTime + * @param Configuration $config */ - public function update($enabled = false, $renderTime = false) + public function update(Configuration $config) { - $this->enabled = $enabled; - $this->rendertime = $renderTime; + $this->enabled = $config->get('system', 'profiler'); + $this->rendertime = $config->get('rendertime', 'callstack'); } /** - * @param bool $enabled True, if the Profiler is enabled - * @param bool $renderTime True, if the Profiler should measure the whole rendertime including functions + * @param ConfigCache $configCache The configuration cache */ - public function __construct($enabled = false, $renderTime = false) + public function __construct(ConfigCache $configCache) { - $this->enabled = $enabled; - $this->rendertime = $renderTime; + $this->enabled = $configCache->get('system', 'profiler'); + $this->rendertime = $configCache->get('rendertime', 'callstack'); $this->reset(); }