diff --git a/boost.api.inc b/boost.api.inc index 5fd192537a5694b3ad7848dbd8603148bd1aa411..d16d53151438e175052bbb91b30908cf447dfea2 100644 --- a/boost.api.inc +++ b/boost.api.inc @@ -60,7 +60,9 @@ function boost_is_cached($path) { */ function boost_cache_clear_all() { clearstatcache(); - return _boost_rmdir_rf(boost_cache_directory()); + if (($cache_dir = boost_cache_directory()) && file_exists($cache_dir)) { + return _boost_rmdir_rf($cache_dir); + } } /** @@ -68,7 +70,9 @@ function boost_cache_clear_all() { */ function boost_cache_expire_all() { clearstatcache(); - _boost_rmdir_rf(boost_cache_directory(), 'boost_file_is_expired'); + if (($cache_dir = boost_cache_directory()) && file_exists($cache_dir)) { + _boost_rmdir_rf($cache_dir, 'boost_file_is_expired'); + } return TRUE; }