diff --git a/boot.php b/boot.php index 5b497632e..4cdd5b76a 100644 --- a/boot.php +++ b/boot.php @@ -767,7 +767,7 @@ class App { } - function get_basepath() { + public static function get_basepath() { $basepath = get_config("system", "basepath"); diff --git a/include/cron.php b/include/cron.php index d7771c08b..008260592 100644 --- a/include/cron.php +++ b/include/cron.php @@ -362,14 +362,14 @@ function cron_clear_cache(&$a) { clear_cache(); // clear cache for photos - clear_cache($a->get_basepath(), $a->get_basepath()."/photo"); + clear_cache(App::get_basepath(), App::get_basepath()."/photo"); // clear smarty cache - clear_cache($a->get_basepath()."/view/smarty3/compiled", $a->get_basepath()."/view/smarty3/compiled"); + clear_cache(App::get_basepath()."/view/smarty3/compiled", App::get_basepath()."/view/smarty3/compiled"); // clear cache for image proxy if (!get_config("system", "proxy_disabled")) { - clear_cache($a->get_basepath(), $a->get_basepath()."/proxy"); + clear_cache(App::get_basepath(), App::get_basepath()."/proxy"); $cachetime = get_config('system','proxy_cache_time'); if (!$cachetime) $cachetime = PROXY_DEFAULT_TIME; diff --git a/mod/photo.php b/mod/photo.php index fc9d9f174..e2fd7887b 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -197,7 +197,7 @@ function photo_init(&$a) { // If the photo is public and there is an existing photo directory store the photo there if ($public and ($file != "")) { // If the photo path isn't there, try to create it - $basepath = $a->get_basepath(); + $basepath = App::get_basepath(); if (!is_dir($basepath."/photo")) if (is_writable($basepath)) mkdir($basepath."/photo"); diff --git a/mod/proxy.php b/mod/proxy.php index 612dc910a..6434cf8e6 100644 --- a/mod/proxy.php +++ b/mod/proxy.php @@ -44,7 +44,7 @@ function proxy_init() { $thumb = false; $size = 1024; $sizetype = ""; - $basepath = $a->get_basepath(); + $basepath = App::get_basepath(); // If the cache path isn't there, try to create it if (!is_dir($basepath."/proxy")) @@ -267,7 +267,7 @@ function proxy_url($url, $writemode = false, $size = '') { $url = html_entity_decode($url, ENT_NOQUOTES, 'utf-8'); // Creating a sub directory to reduce the amount of files in the cache directory - $basepath = $a->get_basepath() . '/proxy'; + $basepath = App::get_basepath() . '/proxy'; $shortpath = hash('md5', $url); $longpath = substr($shortpath, 0, 2);