X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=c6ed818dd1a8ec23f932a1ef4eb826e8c45f7117;hb=9fad4abcec5206974891145810a613a03d5a7cd1;hp=49721547316880afa852b7691d873a9b4d256a41;hpb=425876316ff1934a3a90fc35f908ba8d1581096c;p=friendica.git diff --git a/src/App.php b/src/App.php index 4972154731..c6ed818dd1 100644 --- a/src/App.php +++ b/src/App.php @@ -4,12 +4,10 @@ */ namespace Friendica; -use Detection\MobileDetect; -use DOMDocument; -use DOMXPath; use Exception; use Friendica\App\Arguments; -use Friendica\App\Module; +use Friendica\App\BaseURL; +use Friendica\App\Page; use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Core\Config\Configuration; use Friendica\Core\Config\PConfiguration; @@ -17,12 +15,10 @@ use Friendica\Core\L10n\L10n; use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Database\Database; -use Friendica\Database\DBA; use Friendica\Model\Profile; use Friendica\Module\Login; use Friendica\Module\Special\HTTPException as ModuleHTTPException; use Friendica\Network\HTTPException; -use Friendica\Util\BaseURL; use Friendica\Util\ConfigFileLoader; use Friendica\Util\HTTPSignature; use Friendica\Util\Profiler; @@ -45,8 +41,11 @@ use Psr\Log\LoggerInterface; class App { /** @deprecated 2019.09 - use App\Arguments->getQueryString() */ - public $query_string = ''; - public $page = []; + public $query_string; + /** + * @var Page The current page environment + */ + public $page; public $profile; public $profile_uid; public $user; @@ -67,56 +66,36 @@ class App public $timezone; public $interactive = true; public $identities; - public $is_mobile = false; - public $is_tablet = false; + /** @deprecated 2019.09 - Use App\Mode->isMobile() instead */ + public $is_mobile; + /** @deprecated 2019.09 - Use App\Mode->isTable() instead */ + public $is_tablet; 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 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 bool check if request was an AJAX (xmlhttprequest) request - */ - private $isAjax; - - /** - * @var MobileDetect - */ - public $mobileDetect; + /** @var string The name of the current mobile theme */ + private $currentMobileTheme; /** * @var Configuration The config @@ -149,9 +128,9 @@ class App private $args; /** - * @var App\Module + * @var Core\Process The process methods */ - private $moduleClass; + private $process; /** * Returns the current config cache of this node @@ -225,72 +204,64 @@ class App } /** - * 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() - * - * @param string $path + * @deprecated 2019.09 - use Page->registerStylesheet instead + * @see Page::registerStylesheet() */ 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, '/'); + $this->page->registerStylesheet($path); } /** - * Register a javascript file path to be included in the