X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=97c193b3b7f4937ec68fe62fc390dd1787ba04d2;hb=9239ecc5e0207eb5e62bea36f6ee200e4581932c;hp=a2bdd03df6c1801f1836f8edb5f9fd68eb883adc;hpb=1c3bed1777ea51fabdf1ce91c1c34b7ed0c4b04c;p=friendica.git diff --git a/src/App.php b/src/App.php index a2bdd03df6..97c193b3b7 100644 --- a/src/App.php +++ b/src/App.php @@ -4,19 +4,17 @@ */ namespace Friendica; -use Friendica\Core\Cache; +use Detection\MobileDetect; +use Exception; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; -use Friendica\Database\DBM; -use dba; - -use Detection\MobileDetect; - -use Exception; +use Friendica\Database\DBA; +use Friendica\Network\HTTPException\InternalServerErrorException; require_once 'boot.php'; +require_once 'include/dba.php'; require_once 'include/text.php'; /** @@ -34,15 +32,12 @@ require_once 'include/text.php'; */ class App { - const MODE_NORMAL = 0; - const MODE_INSTALL = 1; - const MODE_MAINTENANCE = 2; - public $module_loaded = false; public $module_class = null; - public $query_string; - public $config; - public $page; + public $query_string = ''; + public $config = []; + public $page = []; + public $pager = []; public $page_offset; public $profile; public $profile_uid; @@ -54,16 +49,12 @@ class App public $content; public $data = []; public $error = false; - public $cmd; + public $cmd = ''; public $argv; public $argc; public $module; - public $mode = App::MODE_NORMAL; - public $pager; public $strings; - public $basepath; - public $path; - public $hooks; + public $hooks = []; public $timezone; public $interactive = true; public $addons; @@ -72,11 +63,9 @@ class App public $identities; public $is_mobile = false; public $is_tablet = false; - public $is_friendica_app; public $performance = []; public $callstack = []; public $theme_info = []; - public $backend = true; public $nav_sel; public $category; // Allow themes to control internal parameters @@ -88,6 +77,76 @@ class App public $force_max_items = 0; public $theme_events_in_profile = true; + public $stylesheets = []; + public $footerScripts = []; + + /** + * @var App\Mode The Mode of the Application + */ + private $mode; + + /** + * @var string The App base path + */ + private $basePath; + + /** + * @var string The App URL path + */ + private $urlPath; + + /** + * @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 + */ + private $currentTheme; + + /** + * @var bool check if request was an AJAX (xmlhttprequest) request + */ + private $isAjax; + + /** + * 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 App->initHead() + * + * @param string $path + */ + public function registerStylesheet($path) + { + $url = str_replace($this->getBasePath() . DIRECTORY_SEPARATOR, '', $path); + + $this->stylesheets[] = trim($url, '/'); + } + + /** + * Register a javascript file path to be included in the