clear_cache() check if cache dir is writable before opening it
This commit is contained in:
parent
6f5589fed3
commit
008eef17c0
2
boot.php
2
boot.php
|
@ -2156,6 +2156,7 @@ function clear_cache($basepath = "", $path = "") {
|
||||||
if ($cachetime == 0)
|
if ($cachetime == 0)
|
||||||
$cachetime = 86400;
|
$cachetime = 86400;
|
||||||
|
|
||||||
|
if (is_writable($path)){
|
||||||
if ($dh = opendir($path)) {
|
if ($dh = opendir($path)) {
|
||||||
while (($file = readdir($dh)) !== false) {
|
while (($file = readdir($dh)) !== false) {
|
||||||
$fullpath = $path."/".$file;
|
$fullpath = $path."/".$file;
|
||||||
|
@ -2167,6 +2168,7 @@ function clear_cache($basepath = "", $path = "") {
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function set_template_engine(&$a, $engine = 'internal') {
|
function set_template_engine(&$a, $engine = 'internal') {
|
||||||
// This function is no longer necessary, but keep it as a wrapper to the class method
|
// This function is no longer necessary, but keep it as a wrapper to the class method
|
||||||
|
|
Loading…
Reference in a new issue