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;
}
/**
- * @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();
}