X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FProfiler.php;h=dc140469c671e945e42408a1b41ff5bd67fd14f9;hb=3940e804e3ee4ac921e109f62a73fac2becaa611;hp=c8c56337180fd04100e1f3673c994bf08efde667;hpb=a81696cd1c0cf334ea4b0f992d61261252b6ea85;p=friendica.git diff --git a/src/Util/Profiler.php b/src/Util/Profiler.php index c8c5633718..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; @@ -43,13 +45,23 @@ class Profiler implements ContainerInterface } /** - * @param bool $enabled True, if the Profiler is enabled - * @param bool $renderTime True, if the Profiler should measure the whole rendertime including functions + * Updates the enabling of the current profiler + * + * @param Configuration $config + */ + public function update(Configuration $config) + { + $this->enabled = $config->get('system', 'profiler'); + $this->rendertime = $config->get('rendertime', 'callstack'); + } + + /** + * @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(); }