function write_static_cache($cache_name,$caches,$newname='',$newfile='')
{
$cache_file_path = ROOT_PATH . '/temp/static_caches/' . $cache_name . '.php';
if(empty($newname))
$newname = $cache_name;
if(empty($newfile))
$newfile = $cache_file_path;
if (!empty($cache_name)){
if ((DEBUG_MODE & 2) == 2)
{
return false;
}
$content = "<?phprn";
$content .= "$data = " . var_export($caches, true) . ";rn";
$content .= "?>";
file_put_contents($cache_file_path, $content, LOCK_EX);
}else{
@file_put_contents($newfile, $newname);
}
}
改为此代码即可,是由于没有加默认值,且老程序只写了两个参数的问题。不知道我写的对不对哈,PHP不支持函数的重载。。。郁闷! |