]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge remote-tracking branch 'upstream/master'
[friendica.git] / boot.php
index e69b59d707c1e7cf131df94ddb6a22c745eb8c40..023c5807c8a4bb40474198711b25d4746b0dee6c 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);