<?php
if(!defined('R_P'))  die("access die");
class cache
{
	function get($key){
		return apc_fetch(self::_hash($key));
	}

	function set($key, $v, $time = 86400){
		return apc_store(self::_hash($key), $v, $time);
	}

	function delete($key){
		return apc_delete(self::_hash($key));
	}
	
	function flush(){
		return apc_clear_cache();
	}

	function _hash($k){
		return (string)sprintf("%u", crc32($k));
	}
}
?>