Vergleich inc/cachehandlers/apc.php - 1.8.6 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 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 20Zeile 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 37Zeile 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 56Zeile 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 native_unserialize() over my_unserialize() for performance reasons
return native_unserialize($data);

		}

return false;

		}

return false;

Zeile 109Zeile 107
	 *
* @return string
*/

	 *
* @return string
*/

	function size_of($name)

	function size_of($name='')

	{
global $lang;


	{
global $lang;