X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=4a620313817fa297c4addb0544631d946ccbf36b;hb=6b8db5ad1333e2b430da3a771d9a962d44d4b6fc;hp=fddfb0a6dadefcaeccd21dc9151c10994c527031;hpb=34748e8ffd6f2138556ea0df93d02231a8cdf4fa;p=friendica.git diff --git a/src/App.php b/src/App.php index fddfb0a6da..4a62031381 100644 --- a/src/App.php +++ b/src/App.php @@ -4,19 +4,22 @@ */ namespace Friendica; -use Detection\MobileDetect; -use DOMDocument; -use DOMXPath; use Exception; -use Friendica\Core\Config\Cache\IConfigCache; -use Friendica\Core\Config\Configuration; -use Friendica\Core\Hook; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; +use Friendica\App\Page; +use Friendica\App\Authentication; +use Friendica\Core\Config\Cache\ConfigCache; +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\DBA; +use Friendica\Database\Database; use Friendica\Model\Profile; -use Friendica\Network\HTTPException\InternalServerErrorException; -use Friendica\Util\BaseURL; -use Friendica\Util\Config\ConfigFileLoader; +use Friendica\Module\Special\HTTPException as ModuleHTTPException; +use Friendica\Network\HTTPException; +use Friendica\Util\ConfigFileLoader; use Friendica\Util\HTTPSignature; use Friendica\Util\Profiler; use Friendica\Util\Strings; @@ -37,9 +40,6 @@ use Psr\Log\LoggerInterface; */ class App { - public $module_class = null; - public $query_string = ''; - public $page = []; public $profile; public $profile_uid; public $user; @@ -49,72 +49,42 @@ class App public $page_contact; public $content; public $data = []; - public $error = false; - public $cmd = ''; + /** @deprecated 2019.09 - use App\Arguments->getArgv() or Arguments->get() */ public $argv; + /** @deprecated 2019.09 - use App\Arguments->getArgc() */ public $argc; - public $module; public $timezone; public $interactive = true; public $identities; - public $is_mobile = false; - public $is_tablet = false; public $theme_info = []; public $category; // Allow themes to control internal parameters // by changing App values in theme.php - public $sourcename = ''; - public $videowidth = 425; - public $videoheight = 350; - public $force_max_items = 0; + public $sourcename = ''; + public $videowidth = 425; + 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 bool true, if the call is from the Friendica APP, otherwise false - */ - private $isFriendicaApp; - - /** - * @var bool true, if the call is from an backend node (f.e. worker) - */ - private $isBackend; - - /** - * @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; @@ -129,141 +99,80 @@ class App private $profiler; /** - * Returns the current config cache of this node - * - * @return IConfigCache + * @var Database The Friendica database connection */ - public function getConfigCache() - { - return $this->config->getCache(); - } + private $database; /** - * Returns the current config of this node - * - * @return Configuration + * @var L10n The translator */ - public function getConfig() - { - return $this->config; - } + private $l10n; /** - * The basepath of this app - * - * @return string - */ - public function getBasePath() - { - return $this->config->get('system', 'basepath'); - } - - /** - * The Logger of this app - * - * @return LoggerInterface + * @var App\Arguments */ - public function getLogger() - { - return $this->logger; - } + private $args; /** - * The profiler of this app - * - * @return Profiler + * @var Core\Process The process methods */ - public function getProfiler() - { - return $this->profiler; - } - - /** - * Returns the Mode of the Application - * - * @return App\Mode The Application Mode - */ - public function getMode() - { - return $this->mode; - } - - /** - * Returns the router of the Application - * - * @return App\Router - */ - public function getRouter() - { - return $this->router; - } + private $process; /** - * 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. - * - * @see initHead() + * Returns the current config cache of this node * - * @param string $path + * @return ConfigCache */ - public function registerStylesheet($path) + public function getConfigCache() { - if (mb_strpos($path, $this->getBasePath() . DIRECTORY_SEPARATOR) === 0) { - $path = mb_substr($path, mb_strlen($this->getBasePath() . DIRECTORY_SEPARATOR)); - } - - $this->stylesheets[] = trim($path, '/'); + return $this->config->getCache(); } /** - * Register a javascript file path to be included in the