Zeile 15 | Zeile 15 |
---|
{ /** * The memcache server resource
|
{ /** * The memcache server resource
|
*/
| * * @var Memcache */
|
public $memcache;
|
public $memcache;
|
/**
| /**
|
* Unique identifier representing this copy of MyBB
|
* Unique identifier representing this copy of MyBB
|
*/
| * * @var string */
|
public $unique_id;
|
public $unique_id;
|
| /** * @param bool $silent */
|
function memcacheCacheHandler($silent=false) { global $mybb;
| function memcacheCacheHandler($silent=false) { global $mybb;
|
Zeile 89 | Zeile 96 |
---|
/** * Retrieve an item from the cache.
|
/** * Retrieve an item from the cache.
|
* * @param string The name of the cache * @param boolean True if we should do a hard refresh
| * * @param string $name The name of the cache * @param boolean $hard_refresh True if we should do a hard refresh
|
* @return mixed Cache data if successful, false if failure */
|
* @return mixed Cache data if successful, false if failure */
|
| |
function fetch($name, $hard_refresh=false) { $data = $this->memcache->get($this->unique_id."_".$name);
| function fetch($name, $hard_refresh=false) { $data = $this->memcache->get($this->unique_id."_".$name);
|
Zeile 112 | Zeile 118 |
---|
/** * Write an item to the cache. *
|
/** * Write an item to the cache. *
|
* @param string The name of the cache * @param mixed The data to write to the cache item
| * @param string $name The name of the cache * @param mixed $contents The data to write to the cache item
|
* @return boolean True on success, false on failure */ function put($name, $contents)
| * @return boolean True on success, false on failure */ function put($name, $contents)
|
Zeile 123 | Zeile 129 |
---|
/** * Delete a cache
|
/** * Delete a cache
|
* * @param string The name of the cache
| * * @param string $name The name of the cache
|
* @return boolean True on success, false on failure
|
* @return boolean True on success, false on failure
|
*/
| */
|
function delete($name)
|
function delete($name)
|
{
| {
|
return $this->memcache->delete($this->unique_id."_".$name);
|
return $this->memcache->delete($this->unique_id."_".$name);
|
}
/**
| }
/**
|
* Disconnect from the cache
|
* Disconnect from the cache
|
*/
| */
|
function disconnect() { @$this->memcache->close(); }
|
function disconnect() { @$this->memcache->close(); }
|
| /** * @param string $name * * @return string */
|
function size_of($name) { global $lang;
| function size_of($name) { global $lang;
|