3 namespace Friendica\Factory;
5 use Friendica\Core\Config\Cache\IConfigCache;
6 use Friendica\Util\Profiler;
11 * Creates a Profiler for the current execution
13 * @param IConfigCache $configCache The configuration cache
17 public static function create(IConfigCache $configCache)
19 $enabled = $configCache->get('system', 'profiler');
20 $enabled = isset($enabled) && $enabled !== '0';
21 $renderTime = $configCache->get('rendertime', 'callstack');
22 $renderTime = isset($renderTime) && $renderTime !== '0';
24 return new Profiler($enabled, $renderTime);