]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge https://github.com/friendica/friendica into pull
[friendica.git] / boot.php
index 2f5ce8caa4911a568697f1f60c53ba7fb7e2a61b..563067ad633b0691db57f0f16abe22455a28df81 100644 (file)
--- 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);