Commit a709435e authored by Nico Schallehn's avatar Nico Schallehn

Cachzeit auf eine Woche Verlängert

parent a8f07bd8
......@@ -3,13 +3,12 @@ include('../api.class.php');
define("Fanart_Key","9902c9197f457401ff7a7eba839213ba");
function jsonCacheDecoder($url){
$CacheFolderName = "jsoncache/";
exec("rm ".$CacheFolderName.date("y-m-d_",time()-3*24*3600)."*");
exec("rm ".$CacheFolderName.date("y-m-d_",time()-2*24*3600)."*");
exec("rm ".$CacheFolderName.date("y-m-d_",time()-24*3600)."*");
exec("rm ".$CacheFolderName.date("y-W_",time()-14*24*3600)."*");
exec("rm ".$CacheFolderName.date("y-W_",time()-7*24*3600)."*");
if(!is_dir($CacheFolderName)){
exec( "mkdir ".$CacheFolderName);
}
$filename= date("y-m-d_",time()).md5($url).".json";
$filename= date("y-W_",time()).md5($url).".json";
if(!file_exists($CacheFolderName.$filename)){
file_put_contents($CacheFolderName.$filename, file_get_contents($url));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment