Refactored DependencyFactory for Profiler

This commit is contained in:
Philipp Holzer 2019-02-17 21:12:12 +01:00
parent cdcf1667d7
commit 5e5c39b0e1
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
12 changed files with 65 additions and 47 deletions

View file

@ -12,7 +12,6 @@ use Friendica\Core\Config\Cache\ConfigCacheLoader;
use Friendica\Core\Config\Cache\IConfigCache;
use Friendica\Core\Config\Configuration;
use Friendica\Database\DBA;
use Friendica\Factory\ConfigFactory;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
@ -114,6 +113,11 @@ class App
*/
private $config;
/**
* @var LoggerInterface The logger
*/
private $logger;
/**
* @var Profiler The profiler of this app
*/
@ -139,6 +143,16 @@ class App
return $this->basePath;
}
/**
* The Logger of this app
*
* @return LoggerInterface
*/
public function getLogger()
{
return $this->logger;
}
/**
* The profiler of this app
*
@ -192,7 +206,7 @@ class App
* @brief App constructor.
*
* @param Configuration $config The Configuration
* @param LoggerInterface $logger Logger of this application
* @param LoggerInterface $logger The current app logger
* @param Profiler $profiler The profiler of this application
* @param bool $isBackend Whether it is used for backend or frontend (Default true=backend)
*
@ -200,8 +214,8 @@ class App
*/
public function __construct(Configuration $config, LoggerInterface $logger, Profiler $profiler, $isBackend = true)
{
$this->config = $config;
$this->logger = $logger;
$this->config = $config;
$this->profiler = $profiler;
$this->basePath = $this->config->get('system', 'basepath');