X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=b3b560a0963f0be40495966d4a6a5030bb8eee73;hb=2ff5889e9a8cdfa6407f72ab821550023b97bfef;hp=cba94fa483f8467bf4633e19bcd7983d98277da8;hpb=a852455d0ed9824fb71c9374c9fffda28f95096f;p=friendica.git diff --git a/boot.php b/boot.php index cba94fa483..b3b560a096 100644 --- a/boot.php +++ b/boot.php @@ -1,6 +1,6 @@ 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 *