X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=419a634fa2ec119200904e2963e91048330f20f4;hb=d0dfcc71a82ac423db68a12fd2eaf6d13cb18e1f;hp=977112c7b5aca98f3a257a0a3756ec1e25987d00;hpb=2bad626be6a17423565a7aa69f001b8997da3efd;p=friendica.git diff --git a/boot.php b/boot.php index 977112c7b5..419a634fa2 100644 --- a/boot.php +++ b/boot.php @@ -21,6 +21,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); use Friendica\App; +use Friendica\Core\System; use Friendica\Core\Config; use Friendica\Util\Lock; @@ -40,9 +41,9 @@ require_once 'include/poller.php'; define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_CODENAME', 'Asparagus'); -define ( 'FRIENDICA_VERSION', '3.5.3-dev' ); +define ( 'FRIENDICA_VERSION', '3.5.3-rc' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1233 ); +define ( 'DB_UPDATE_VERSION', 1234 ); /** * @brief Constant with a HTML line break. @@ -228,8 +229,9 @@ define('PROTOCOL_UNKNOWN', 0); define('PROTOCOL_DFRN', 1); define('PROTOCOL_DIASPORA', 2); define('PROTOCOL_OSTATUS_SALMON', 3); -define('PROTOCOL_OSTATUS_FEED', 4); -define('PROTOCOL_GS_CONVERSATION', 5); +define('PROTOCOL_OSTATUS_FEED', 4); // Deprecated +define('PROTOCOL_GS_CONVERSATION', 5); // Deprecated +define('PROTOCOL_SPLITTED_CONV', 6); /** @}*/ /** @@ -319,6 +321,8 @@ define ( 'NOTIFY_TAGSHARE', 0x0100 ); define ( 'NOTIFY_POKE', 0x0200 ); define ( 'NOTIFY_SHARE', 0x0400 ); +define ( 'SYSTEM_EMAIL', 0x4000 ); + define ( 'NOTIFY_SYSTEM', 0x8000 ); /* @}*/ @@ -390,6 +394,7 @@ define ( 'ACTIVITY_POST', NAMESPACE_ACTIVITY_SCHEMA . 'post' ); define ( 'ACTIVITY_UPDATE', NAMESPACE_ACTIVITY_SCHEMA . 'update' ); define ( 'ACTIVITY_TAG', NAMESPACE_ACTIVITY_SCHEMA . 'tag' ); define ( 'ACTIVITY_FAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'favorite' ); +define ( 'ACTIVITY_UNFAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'unfavorite' ); define ( 'ACTIVITY_SHARE', NAMESPACE_ACTIVITY_SCHEMA . 'share' ); define ( 'ACTIVITY_DELETE', NAMESPACE_ACTIVITY_SCHEMA . 'delete' ); @@ -551,31 +556,16 @@ function system_unavailable() { killme(); } -function clean_urls() { - $a = get_app(); - return true; -} - -function z_path() { - $base = App::get_baseurl(); - - if (!clean_urls()) { - $base .= '/?q='; - } - - return $base; -} - /** * @brief Returns the baseurl. * - * @see App::get_baseurl() + * @see System::baseUrl() * * @return string - * @TODO Maybe super-flous and deprecated? Seems to only wrap App::get_baseurl() + * @TODO Function is deprecated and only used in some addons */ function z_root() { - return App::get_baseurl(); + return System::baseUrl(); } /** @@ -628,10 +618,10 @@ function check_url(App $a) { // We will only change the url to an ip address if there is no existing setting if (!x($url)) { - $url = set_config('system', 'url', App::get_baseurl()); + $url = set_config('system', 'url', System::baseUrl()); } - if ((!link_compare($url, App::get_baseurl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) { - $url = set_config('system', 'url', App::get_baseurl()); + if ((!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) { + $url = set_config('system', 'url', System::baseUrl()); } return; @@ -913,7 +903,7 @@ function killme() { */ function goaway($s) { if (!strstr(normalise_link($s), "http://")) { - $s = App::get_baseurl() . "/" . $s; + $s = System::baseUrl() . "/" . $s; } header("Location: $s"); @@ -961,6 +951,10 @@ function public_contact() { * @return int|bool visitor_id or false */ function remote_user() { + // You cannot be both local and remote + if (local_user()) { + return false; + } if ((x($_SESSION, 'authenticated')) && (x($_SESSION, 'visitor_id'))) { return intval($_SESSION['visitor_id']); } @@ -1090,9 +1084,9 @@ function proc_run($cmd) { array_shift($argv); $parameters = json_encode($argv); - $found = dba::select('workerqueue', array('id'), array('parameter' => $parameters, 'done' => false), array('limit' => 1)); + $found = dba::exists('workerqueue', array('parameter' => $parameters, 'done' => false)); - if (!dbm::is_result($found)) { + if (!$found) { dba::insert('workerqueue', array('parameter' => $parameters, 'created' => $created, 'priority' => $priority)); } @@ -1399,7 +1393,7 @@ function get_temppath() { if (($temppath != "") && App::directory_usable($temppath)) { // We have a temp path and it is usable - return $temppath; + return App::realpath($temppath); } // We don't have a working preconfigured temp path, so we take the system path. @@ -1407,6 +1401,9 @@ function get_temppath() { // Check if it is usable if (($temppath != "") && App::directory_usable($temppath)) { + // Always store the real path, not the path through symlinks + $temppath = App::realpath($temppath); + // To avoid any interferences with other systems we create our own directory $new_temppath = $temppath . "/" . $a->get_hostname(); if (!is_dir($new_temppath)) { @@ -1495,7 +1492,7 @@ function get_itemcachepath() { $itemcache = get_config('system', 'itemcache'); if (($itemcache != "") && App::directory_usable($itemcache)) { - return $itemcache; + return App::realpath($itemcache); } $temppath = get_temppath();