mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
62 lines
1.1 KiB
PHP
62 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
*
|
|
* @package testing
|
|
* @copyright (c) 2014 phpBB Group
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
|
*
|
|
*/
|
|
|
|
require_once dirname(__FILE__) . '/../../phpBB/includes/acm/acm_memory.php';
|
|
|
|
class phpbb_cache_memory extends acm_memory
|
|
{
|
|
protected $data = array();
|
|
|
|
/**
|
|
* Set cache path
|
|
*/
|
|
function phpbb_cache_memory()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Fetch an item from the cache
|
|
*
|
|
* @access protected
|
|
* @param string $var Cache key
|
|
* @return mixed Cached data
|
|
*/
|
|
function _read($var)
|
|
{
|
|
return $this->data[$var];
|
|
}
|
|
|
|
/**
|
|
* Store data in the cache
|
|
*
|
|
* @access protected
|
|
* @param string $var Cache key
|
|
* @param mixed $data Data to store
|
|
* @param int $ttl Time-to-live of cached data
|
|
* @return bool True if the operation succeeded
|
|
*/
|
|
function _write($var, $data, $ttl = 2592000)
|
|
{
|
|
$this->data[$var] = $data;
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Remove an item from the cache
|
|
*
|
|
* @access protected
|
|
* @param string $var Cache key
|
|
* @return bool True if the operation succeeded
|
|
*/
|
|
function _delete($var)
|
|
{
|
|
unset($this->data[$var]);
|
|
return true;
|
|
}
|
|
}
|