Zeile 11 | Zeile 11 |
---|
/** * APC Cache Handler */
|
/** * APC Cache Handler */
|
class apcCacheHandler
| class apcCacheHandler implements CacheHandlerInterface
|
{ /** * Unique identifier representing this copy of MyBB
| { /** * Unique identifier representing this copy of MyBB
|
Zeile 20 | Zeile 20 |
---|
*/ public $unique_id;
|
*/ public $unique_id;
|
/** * @param bool $silent ignored */ function __construct($silent=false)
| function __construct()
|
{ global $mybb;
if(!function_exists("apc_fetch"))
|
{ global $mybb;
if(!function_exists("apc_fetch"))
|
{
| {
|
// Check if our DB engine is loaded if(!extension_loaded("apc")) {
| // Check if our DB engine is loaded if(!extension_loaded("apc")) {
|
Zeile 37 | Zeile 34 |
---|
die; } }
|
die; } }
|
}
/** * Connect and initialize this handler. * * @return boolean True if successful, false on failure */
| }
/** * Connect and initialize this handler. * * @return boolean True if successful, false on failure */
|
function connect() { // Set a unique identifier for all queries in case other forums on this server also use this cache handler $this->unique_id = md5(MYBB_ROOT);
|
function connect() { // Set a unique identifier for all queries in case other forums on this server also use this cache handler $this->unique_id = md5(MYBB_ROOT);
|
|
|
return true; }
| return true; }
|
Zeile 56 | Zeile 53 |
---|
* Connect and initialize this handler. * * @param string $name
|
* Connect and initialize this handler. * * @param string $name
|
* @param bool $hard_refresh ignored
| |
* @return boolean True if successful, false on failure */
|
* @return boolean True if successful, false on failure */
|
function fetch($name, $hard_refresh=false)
| function fetch($name)
|
{ if(apc_exists($this->unique_id."_".$name)) { $data = apc_fetch($this->unique_id."_".$name);
|
{ if(apc_exists($this->unique_id."_".$name)) { $data = apc_fetch($this->unique_id."_".$name);
|
return unserialize($data);
| // use PHP's own unserialize() for performance reasons return unserialize($data, array('allowed_classes' => false));
|
}
return false;
| }
return false;
|
Zeile 109 | Zeile 107 |
---|
* * @return string */
|
* * @return string */
|
function size_of($name)
| function size_of($name='')
|
{ global $lang;
| { global $lang;
|