X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=925b24c9e7b6ace3705e901014e0ed7022770f1d;hb=0a4119adaf6294bf43d135a0f435c1dd677c50e0;hp=749cbe9cc9ded105e4a49361c6c36507307ad4eb;hpb=feb720a3ee7a0b75e7cc2c78d12b848dc0a7894c;p=friendica.git diff --git a/src/App.php b/src/App.php index 749cbe9cc9..925b24c9e7 100644 --- a/src/App.php +++ b/src/App.php @@ -4,21 +4,18 @@ */ namespace Friendica; -use Detection\MobileDetect; -use DOMDocument; -use DOMXPath; use Exception; use Friendica\App\Arguments; use Friendica\App\BaseURL; +use Friendica\App\Authentication; use Friendica\Core\Config\Cache\ConfigCache; -use Friendica\Core\Config\Configuration; -use Friendica\Core\Config\PConfiguration; +use Friendica\Core\Config\IConfiguration; +use Friendica\Core\Config\IPConfiguration; use Friendica\Core\L10n\L10n; use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Database\Database; use Friendica\Model\Profile; -use Friendica\Module\Login; use Friendica\Module\Special\HTTPException as ModuleHTTPException; use Friendica\Network\HTTPException; use Friendica\Util\ConfigFileLoader; @@ -31,7 +28,7 @@ use Psr\Log\LoggerInterface; * * class: App * - * @brief Our main application structure for the life of this page. + * Our main application structure for the life of this page. * * Primarily deals with the URL that got us here * and tries to make some sense of it, and @@ -42,9 +39,6 @@ use Psr\Log\LoggerInterface; */ class App { - /** @deprecated 2019.09 - use App\Arguments->getQueryString() */ - public $query_string; - public $page; public $profile; public $profile_uid; public $user; @@ -54,20 +48,14 @@ class App public $page_contact; public $content; public $data = []; - /** @deprecated 2019.09 - use App\Arguments->getCommand() */ - public $cmd = ''; /** @deprecated 2019.09 - use App\Arguments->getArgv() or Arguments->get() */ public $argv; /** @deprecated 2019.09 - use App\Arguments->getArgc() */ public $argc; - /** @deprecated 2019.09 - Use App\Module->getName() instead */ - public $module; public $timezone; public $interactive = true; public $identities; - public $is_mobile; - public $is_tablet; - public $theme_info = []; + public $theme_info = []; public $category; // Allow themes to control internal parameters // by changing App values in theme.php @@ -77,42 +65,25 @@ class App public $videoheight = 350; public $force_max_items = 0; public $theme_events_in_profile = true; - - public $stylesheets = []; - public $footerScripts = []; + public $queue; /** * @var App\Mode The Mode of the Application */ private $mode; - /** - * @var App\Router - */ - private $router; - /** * @var BaseURL */ private $baseURL; - /** - * @var string The name of the current theme - */ + /** @var string The name of the current theme */ private $currentTheme; + /** @var string The name of the current mobile theme */ + private $currentMobileTheme; /** - * @var bool check if request was an AJAX (xmlhttprequest) request - */ - private $isAjax; - - /** - * @var MobileDetect - */ - public $mobileDetect; - - /** - * @var Configuration The config + * @var IConfiguration The config */ private $config; @@ -141,6 +112,16 @@ class App */ private $args; + /** + * @var Core\Process The process methods + */ + private $process; + + /** + * @var IPConfiguration + */ + private $pConfig; + /** * Returns the current config cache of this node * @@ -151,16 +132,6 @@ class App return $this->config->getCache(); } - /** - * Returns the current config of this node - * - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - /** * The basepath of this app * @@ -173,131 +144,32 @@ class App } /** - * The Logger of this app - * - * @return LoggerInterface - */ - public function getLogger() - { - return $this->logger; - } - - /** - * The profiler of this app - * - * @return Profiler - */ - public function getProfiler() - { - return $this->profiler; - } - - /** - * Returns the Mode of the Application - * - * @return App\Mode The Application Mode + * @param Database $database The Friendica Database + * @param IConfiguration $config The Configuration + * @param App\Mode $mode The mode of this Friendica app + * @param BaseURL $baseURL The full base URL of this Friendica app + * @param LoggerInterface $logger The current app logger + * @param Profiler $profiler The profiler of this application + * @param L10n $l10n The translator instance + * @param App\Arguments $args The Friendica Arguments of the call + * @param Core\Process $process The process methods + * @param IPConfiguration $pConfig Personal configuration */ - public function getMode() + public function __construct(Database $database, IConfiguration $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, Core\Process $process, IPConfiguration $pConfig) { - return $this->mode; - } + $this->database = $database; + $this->config = $config; + $this->mode = $mode; + $this->baseURL = $baseURL; + $this->profiler = $profiler; + $this->logger = $logger; + $this->l10n = $l10n; + $this->args = $args; + $this->process = $process; + $this->pConfig = $pConfig; - /** - * Returns the Database of the Application - * - * @return Database - */ - public function getDBA() - { - return $this->database; - } - - /** - * Register a stylesheet file path to be included in the tag of every page. - * Inclusion is done in App->initHead(). - * The path can be absolute or relative to the Friendica installation base folder. - * - * @param string $path - * - * @see initHead() - * - */ - public function registerStylesheet($path) - { - if (mb_strpos($path, $this->getBasePath() . DIRECTORY_SEPARATOR) === 0) { - $path = mb_substr($path, mb_strlen($this->getBasePath() . DIRECTORY_SEPARATOR)); - } - - $this->stylesheets[] = trim($path, '/'); - } - - /** - * Register a javascript file path to be included in the