Untitled
By: a guest | Feb 8th, 2010 | Syntax:
PHP | Size: 0.97 KB | Hits: 43 | Expires: Never
<?php
class ControlPanel_Cache extends ControlPanel_Main
{
public $cacheDir = 'UCP_cache/';
public function _cacheExists($id)
{
return true;
}
return false;
}
public function _saveCache($id,$data)
{
if($this->_cacheExists($id)) {
return false;
} else {
$fp = fopen($this->cacheDir.$id.'.cache','w');
return true;
}
}
public function _getCacheAge($id)
{
if($this->_cacheExists($id)) {
//if($x < 0) $x = 0;
return (int)$x;
}
return 0;
}
public function _deleteCache($id)
{
if($this->_cacheExists($id)) {
unlink($this->cacheDir.$id.'.cache');
return true;
}
return false;
}
public function _loadCache($id)
{
if($this->_cacheExists($id)) {
return $fp;
}
}
}
?>