mirror of
https://github.com/friendica/friendica
synced 2025-02-13 00:14:00 +00:00
Refactor App, add AppHelper in constructor
This commit is contained in:
parent
00d2e24dd2
commit
b5317f8e46
1 changed files with 11 additions and 5 deletions
16
src/App.php
16
src/App.php
|
@ -125,6 +125,11 @@ class App
|
||||||
*/
|
*/
|
||||||
private $session;
|
private $session;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var AppHelper $appHelper
|
||||||
|
*/
|
||||||
|
private $appHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the profile owner ID
|
* Set the profile owner ID
|
||||||
*
|
*
|
||||||
|
@ -156,7 +161,7 @@ class App
|
||||||
*/
|
*/
|
||||||
public function setContactId(int $contact_id)
|
public function setContactId(int $contact_id)
|
||||||
{
|
{
|
||||||
DI::apphelper()->setContactId($contact_id);
|
$this->appHelper->setContactId($contact_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,7 +173,7 @@ class App
|
||||||
*/
|
*/
|
||||||
public function getContactId(): int
|
public function getContactId(): int
|
||||||
{
|
{
|
||||||
return DI::apphelper()->getContactId();
|
return $this->appHelper->getContactId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,7 +186,7 @@ class App
|
||||||
*/
|
*/
|
||||||
public function setTimeZone(string $timezone)
|
public function setTimeZone(string $timezone)
|
||||||
{
|
{
|
||||||
DI::apphelper()->setTimeZone($timezone);
|
$this->appHelper->setTimeZone($timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,7 +196,7 @@ class App
|
||||||
*/
|
*/
|
||||||
public function getTimeZone(): string
|
public function getTimeZone(): string
|
||||||
{
|
{
|
||||||
return DI::apphelper()->getTimeZone();
|
return $this->appHelper->getTimeZone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -303,6 +308,7 @@ class App
|
||||||
$this->args = $args;
|
$this->args = $args;
|
||||||
$this->pConfig = $pConfig;
|
$this->pConfig = $pConfig;
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
|
$this->appHelper = DI::apphelper();
|
||||||
|
|
||||||
$this->load($dbaDefinition, $viewDefinition);
|
$this->load($dbaDefinition, $viewDefinition);
|
||||||
}
|
}
|
||||||
|
@ -367,7 +373,7 @@ class App
|
||||||
$timezone = $default_timezone ?? '' ?: 'UTC';
|
$timezone = $default_timezone ?? '' ?: 'UTC';
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::apphelper()->setTimeZone($timezone);
|
$this->appHelper->setTimeZone($timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue