X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=3e34d3c5a9e76c824e91f329d1c4afc69bd755a4;hb=0373056448aec398ee765065adc998aa0da02ac0;hp=67dfacf7a3fb891d0409da759b1768703cbe9c28;hpb=10089c6e4e68fdf4165ea3b4a4d7c776a3f61f79;p=friendica.git diff --git a/src/App.php b/src/App.php index 67dfacf7a3..3e34d3c5a9 100644 --- a/src/App.php +++ b/src/App.php @@ -3,12 +3,12 @@ namespace Friendica; use Friendica\Core\System; +use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Database\DBM; -use Cache; use dba; -use dbm; use Detection\MobileDetect; @@ -73,7 +73,6 @@ class App { public $videowidth = 425; public $videoheight = 350; public $force_max_items = 0; - public $theme_thread_allow = true; public $theme_events_in_profile = true; /** @@ -87,7 +86,6 @@ class App { 'videowidth' => 425, 'videoheight' => 350, 'force_max_items' => 0, - 'thread_allow' => true, 'stylesheet' => '', 'template_engine' => 'smarty3', ); @@ -132,8 +130,14 @@ class App { $hostname = ''; - if (file_exists('.htpreconfig.php')) { - include '.htpreconfig.php'; + if (! static::directory_usable($basepath, false)) { + throw new Exception('Basepath ' . $basepath . ' isn\'t usable.'); + } + + $this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR); + + if (file_exists($this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php')) { + include $this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php'; } $this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC'); @@ -201,17 +205,10 @@ class App { $this->hostname = $hostname; } - if (! static::directory_usable($basepath, false)) { - throw new Exception('Basepath ' . $basepath . ' isn\'t usable.'); - } - - $this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR); - set_include_path( get_include_path() . PATH_SEPARATOR . $this->basepath . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR . $this->basepath . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR - . $this->basepath . DIRECTORY_SEPARATOR . 'library/langdet' . PATH_SEPARATOR . $this->basepath); @@ -296,7 +293,7 @@ class App { // Register template engines $dc = get_declared_classes(); foreach ($dc as $k) { - if (in_array('ITemplateEngine', class_implements($k))) { + if (in_array('Friendica\Render\ITemplateEngine', class_implements($k))) { $this->register_template_engine($k); } } @@ -416,8 +413,8 @@ class App { $this->path = trim($parsed['path'], '\\/'); } - if (file_exists('.htpreconfig.php')) { - include '.htpreconfig.php'; + if (file_exists($this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php')) { + include $this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php'; } if (Config::get('config', 'hostname') != '') { @@ -707,7 +704,7 @@ class App { dba::transaction(); $r = q('SELECT `pid` FROM `process` WHERE `pid` = %d', intval(getmypid())); - if (!dbm::is_result($r)) { + if (!DBM::is_result($r)) { dba::insert('process', array('pid' => getmypid(), 'command' => $command, 'created' => datetime_convert())); } dba::commit(); @@ -720,10 +717,10 @@ class App { dba::transaction(); $r = q('SELECT `pid` FROM `process`'); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { foreach ($r AS $process) { if (!posix_kill($process['pid'], 0)) { - q('DELETE FROM `process` WHERE `pid` = %d', intval($process['pid'])); + dba::delete('process', array('pid' => $process['pid'])); } } } @@ -734,7 +731,7 @@ class App { * @brief Remove the active process from the "process" table */ function end_process() { - q('DELETE FROM `process` WHERE `pid` = %d', intval(getmypid())); + dba::delete('process', array('pid' => getmypid())); } function get_useragent() { @@ -807,7 +804,7 @@ class App { } } - $processlist = dbm::processlist(); + $processlist = DBM::processlist(); if ($processlist['list'] != '') { logger('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], LOGGER_DEBUG);