optimise cachefile logic - still not sure why the cachefile profiling was getting triggered on a site with no cachefile configured

This commit is contained in:
friendica 2013-05-02 21:59:20 -07:00
parent 2a3288b01e
commit ed5768c4a3

View file

@ -2099,10 +2099,7 @@ function random_digits($digits) {
function get_cachefile($file, $writemode = true) { function get_cachefile($file, $writemode = true) {
$cache = get_config("system","itemcache"); $cache = get_config("system","itemcache");
if ($cache == "") if ((! $cache) || (! is_dir($cache)))
return("");
if (!is_dir($cache))
return(""); return("");
$subfolder = $cache."/".substr($file, 0, 2); $subfolder = $cache."/".substr($file, 0, 2);