X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=023c5807c8a4bb40474198711b25d4746b0dee6c;hb=a6b1275f16ab67a26ac1a4cc18cffd3d454b0940;hp=e69b59d707c1e7cf131df94ddb6a22c745eb8c40;hpb=0f1592547e7a6e3a474ecc20c63b8e3add47a8b4;p=friendica.git diff --git a/boot.php b/boot.php index e69b59d707..023c5807c8 100644 --- a/boot.php +++ b/boot.php @@ -520,6 +520,19 @@ if(! class_exists('App')) { $this->is_tablet = $mobile_detect->isTablet(); } + function get_basepath() { + + $basepath = get_config("system", "basepath"); + + if ($basepath == "") + $basepath = $_SERVER["DOCUMENT_ROOT"]; + + if ($basepath == "") + $basepath = $_SERVER["PWD"]; + + return($basepath); + } + function get_baseurl($ssl = false) { $scheme = $this->scheme; @@ -1895,7 +1908,7 @@ function clear_cache($basepath = "", $path = "") { $fullpath = $path."/".$file; if ((filetype($fullpath) == "dir") and ($file != ".") and ($file != "..")) clear_cache($basepath, $fullpath); - if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - $cachetime)) + if ((filetype($fullpath) == "file") and (filectime($fullpath) < (time() - $cachetime))) unlink($fullpath); } closedir($dh);