mirror of
https://github.com/friendica/friendica
synced 2025-05-12 11:04:10 +02:00
Introducing Profiler
This commit is contained in:
parent
12ff467a9b
commit
5e6e1a8025
24 changed files with 370 additions and 262 deletions
25
src/Factory/ProfilerFactory.php
Normal file
25
src/Factory/ProfilerFactory.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Factory;
|
||||
|
||||
use Friendica\Core\Config\ConfigCache;
|
||||
use Friendica\Util\Profiler;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class ProfilerFactory
|
||||
{
|
||||
/**
|
||||
* Creates a Profiler for the current execution
|
||||
*
|
||||
* @param LoggerInterface $logger The logger for saving the profiling data
|
||||
* @param ConfigCache $configCache The configuration cache
|
||||
*
|
||||
* @return Profiler
|
||||
*/
|
||||
public static function create(LoggerInterface $logger, ConfigCache $configCache)
|
||||
{
|
||||
$enabled = $configCache->get('system', 'profiler', false);
|
||||
$renderTime = $configCache->get('rendertime', 'callstack', false);
|
||||
return new Profiler($logger, $enabled, $renderTime);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue