X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=ecf59eb2fc587140cfd5e1dbd50049a754286e4d;hb=25f0f0c4396ece49634be517b92d638ef9c73505;hp=47f626629f6f489d89ac472ab3202b7f5f6083e2;hpb=d1d208f18b9b43916378ccfd09b963246fe631dd;p=friendica.git diff --git a/boot.php b/boot.php index 47f626629f..ecf59eb2fc 100644 --- a/boot.php +++ b/boot.php @@ -38,7 +38,7 @@ use Friendica\Util\DateTimeFormat; define('FRIENDICA_PLATFORM', 'Friendica'); define('FRIENDICA_CODENAME', 'Siberian Iris'); -define('FRIENDICA_VERSION', '2021.07'); +define('FRIENDICA_VERSION', '2021.09-dev'); define('DFRN_PROTOCOL_VERSION', '2.23'); define('NEW_TABLE_STRUCTURE_VERSION', 1288); @@ -297,13 +297,11 @@ function notice($s) return; } - $a = DI::app(); if (empty($_SESSION['sysmsg'])) { $_SESSION['sysmsg'] = []; } - if ($a->interactive) { - $_SESSION['sysmsg'][] = $s; - } + + $_SESSION['sysmsg'][] = $s; } /** @@ -315,14 +313,15 @@ function notice($s) */ function info($s) { - $a = DI::app(); + if (empty($_SESSION)) { + return; + } if (empty($_SESSION['sysmsg_info'])) { $_SESSION['sysmsg_info'] = []; } - if ($a->interactive) { - $_SESSION['sysmsg_info'][] = $s; - } + + $_SESSION['sysmsg_info'][] = $s; } function feed_birthday($uid, $tz) @@ -444,93 +443,6 @@ function get_temppath() return ''; } -function get_cachefile($file, $writemode = true) -{ - $cache = get_itemcachepath(); - - if ((!$cache) || (!is_dir($cache))) { - return ""; - } - - $subfolder = $cache . "/" . substr($file, 0, 2); - - $cachepath = $subfolder . "/" . $file; - - if ($writemode) { - if (!is_dir($subfolder)) { - mkdir($subfolder); - chmod($subfolder, 0777); - } - } - - return $cachepath; -} - -function clear_cache($basepath = "", $path = "") -{ - if ($path == "") { - $basepath = get_itemcachepath(); - $path = $basepath; - } - - if (($path == "") || (!is_dir($path))) { - return; - } - - if (substr(realpath($path), 0, strlen($basepath)) != $basepath) { - return; - } - - $cachetime = (int) DI::config()->get('system', 'itemcache_duration'); - if ($cachetime == 0) { - $cachetime = 86400; - } - - if (is_writable($path)) { - if ($dh = opendir($path)) { - while (($file = readdir($dh)) !== false) { - $fullpath = $path . "/" . $file; - if ((filetype($fullpath) == "dir") && ($file != ".") && ($file != "..")) { - clear_cache($basepath, $fullpath); - } - if ((filetype($fullpath) == "file") && (filectime($fullpath) < (time() - $cachetime))) { - unlink($fullpath); - } - } - closedir($dh); - } - } -} - -function get_itemcachepath() -{ - // Checking, if the cache is deactivated - $cachetime = (int) DI::config()->get('system', 'itemcache_duration'); - if ($cachetime < 0) { - return ""; - } - - $itemcache = DI::config()->get('system', 'itemcache'); - if (($itemcache != "") && System::isDirectoryUsable($itemcache)) { - return BasePath::getRealPath($itemcache); - } - - $temppath = get_temppath(); - - if ($temppath != "") { - $itemcache = $temppath . "/itemcache"; - if (!file_exists($itemcache) && !is_dir($itemcache)) { - mkdir($itemcache); - } - - if (System::isDirectoryUsable($itemcache)) { - DI::config()->set("system", "itemcache", $itemcache); - return $itemcache; - } - } - return ""; -} - /** * Returns the path where spool files are stored *