一个强大的PHP缓存类(11)
}
else{
$this->addLog('reading APP key:'.$var);
return $this->application[md5($var)];//return value
}
}
}
//////////End Cache for APP variables///////////////////
////DEBUG
//sets debug on or off
public function setDebug($state){
$this->debug=(bool) $state;
}
public function returnDebug($type='HTML'){
if ($this->debug){
switch($type){
case 'array':
return $this->log;
break;
case 'HTML'://returns debug as HTML
echo '<ol>';
foreach($this->log as $key=>$value){//loop in the log var
echo '<li>'.$value.'</li>';
}
echo '</ol>';
break;
}
}
else return false;
}
//add debug log
public function addLog($value){
if ($this->debug){//only if debug enabled
array_push($this->log, round((microtime(true) - $this->start_time),5).'s - '. $value);
}
}
}
?>
顶(0)
踩(0)
- 最新评论
