0byt3m1n1
Path:
/
home1
/
aserty
/
public_html
/
appartsoft.info
/
wp-content
/
plugins
/
affiliate-mage
/
classes
/
[
Home
]
File: cache.class.php
<?php class l1t { function __construct($O1p) { $this->O1p =$O1p; $lg=get_option('AM_Options'); $O8l=($lg['AM_Cache_Timeout'] != NULL) ? $lg['AM_Cache_Timeout']: 0; if ($O8l>0) { $this->O8l =$O8l*074*074; } else { $this->O8l =0; } } private function l8m($Oj) { return sprintf("%s/%s",$this->O1p ,sha1($Oj)); } public function l2f($Oj,$O8m=FALSE) { if ($this->O8l == 0) { return FALSE; } if (!is_dir($this->O1p) or !is_writable($this->O1p)) { return FALSE; } $l8n=$this->l8m($Oj); if (!@file_exists($l8n)) { return FALSE; } if (filemtime($l8n)<(time()-$this->O8l)) { $this->clear($Oj); return FALSE; } if (!$l3k=@fopen($l8n,'r')) { return FALSE; } flock($l3k,LOCK_SH); $O1s=''; if (filesize($l8n)>0) { if ($O8m) { $O1s=@unserialize(base64_decode(fread($l3k,filesize($l8n)))); } else { $O1s=fread($l3k,filesize($l8n)); } } else { $O1s=NULL; } flock($l3k,LOCK_UN); fclose($l3k); return $O1s; } public function set($Oj,$data,$O8m=FALSE) { if (!is_dir($this->O1p) or !is_writable($this->O1p)) { return FALSE; } $l8n=$this->l8m($Oj); if (!$l3k=fopen($l8n,'w')) { return FALSE; } if (flock($l3k,LOCK_EX)) { if ($O8m) { fwrite($l3k,base64_encode(serialize($data))); } else { fwrite($l3k,$data); } flock($l3k,LOCK_UN); } else { return FALSE; } fclose($l3k); @chmod($l8n,0777); return TRUE; } public function clear($Oj) { $l8n=$this->l8m($Oj); if (file_exists($l8n)) { unlink($l8n); return TRUE; } return FALSE; } public function O1t() { $lg=get_option('AM_Options'); $O8n=$lg['AM_Cache_Timeout']*074*074; $O5h=$this->O1p; $lb=opendir($O5h); if ($lb) { while (FALSE !== ($O3j=readdir($lb))) { if ((time()-filemtime($O5h.$O3j))>$O8n) { @unlink($O5h.$O3j); } } } } }?>