Vergleich inc/class_datacache.php - 1.8.22 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 93Zeile 93
			case "apc":
require_once MYBB_ROOT."/inc/cachehandlers/apc.php";
$this->handler = new apcCacheHandler();

			case "apc":
require_once MYBB_ROOT."/inc/cachehandlers/apc.php";
$this->handler = new apcCacheHandler();

 
				break;
// APCu cache
case "apcu":
require_once MYBB_ROOT."/inc/cachehandlers/apcu.php";
$this->handler = new apcuCacheHandler();
break;
// Redis cache
case "redis":
require_once MYBB_ROOT."/inc/cachehandlers/redis.php";
$this->handler = new redisCacheHandler();

				break;
}


				break;
}


Zeile 122Zeile 132
	 * @return mixed
*/
function read($name, $hard=false)

	 * @return mixed
*/
function read($name, $hard=false)

	{
global $db, $mybb;


	{
global $db, $mybb;


		// Already have this cache and we're not doing a hard refresh? Return cached copy
if(isset($this->cache[$name]) && $hard == false)
{

		// Already have this cache and we're not doing a hard refresh? Return cached copy
if(isset($this->cache[$name]) && $hard == false)
{

Zeile 138Zeile 148
		}

if($this->handler instanceof CacheHandlerInterface)

		}

if($this->handler instanceof CacheHandlerInterface)

		{
get_execution_time();

		{
get_execution_time();


$data = $this->handler->fetch($name);



$data = $this->handler->fetch($name);


Zeile 185Zeile 195
		{
$query = $db->simple_select("datacache", "title,cache", "title='$name'");
$cache_data = $db->fetch_array($query);

		{
$query = $db->simple_select("datacache", "title,cache", "title='$name'");
$cache_data = $db->fetch_array($query);





			if(!$cache_data['title'])

			if(!$cache_data['title'])

			{

			{

				$data = false;

				$data = false;

			}

			}

			else
{
$data = unserialize($cache_data['cache']);
}
}

			else
{
$data = unserialize($cache_data['cache']);
}
}





		// Cache locally
$this->cache[$name] = $data;

if($data !== false)

		// Cache locally
$this->cache[$name] = $data;

if($data !== false)

		{

		{

			return $data;

			return $data;

		}

		}

		else
{
return false;

		else
{
return false;

Zeile 216Zeile 226
	 * @param mixed $contents The cache content.
*/
function update($name, $contents)

	 * @param mixed $contents The cache content.
*/
function update($name, $contents)

	{
global $db, $mybb;

	{
global $db, $mybb;


$this->cache[$name] = $contents;



$this->cache[$name] = $contents;


Zeile 231Zeile 241
		$db->replace_query("datacache", $replace_array, "", false);

// Do we have a cache handler we're using?

		$db->replace_query("datacache", $replace_array, "", false);

// Do we have a cache handler we're using?

		if($this->handler instanceof CacheHandlerInterface)

		if($this->handler instanceof CacheHandlerInterface)

		{
get_execution_time();


		{
get_execution_time();


Zeile 323Zeile 333
					{
$filename = substr($filename, $start, strlen($filename)-4-$start);
$names[$filename] = 0;

					{
$filename = substr($filename, $start, strlen($filename)-4-$start);
$names[$filename] = 0;

					}
}


					}
}


				foreach($names as $key => $val)
{
get_execution_time();


				foreach($names as $key => $val)
{
get_execution_time();


					$hit = $this->handler->delete($key);


					$hit = $this->handler->delete($key);


					$call_time = get_execution_time();
$this->call_time += $call_time;
$this->call_count++;

					$call_time = get_execution_time();
$this->call_time += $call_time;
$this->call_count++;

Zeile 339Zeile 349
					if($mybb->debug_mode)
{
$this->debug_call('delete:'.$name, $call_time, $hit);

					if($mybb->debug_mode)
{
$this->debug_call('delete:'.$name, $call_time, $hit);

					}
}
}
}

					}
}
}
}


// Delete database cache
$db->delete_query("datacache", $where);


// Delete database cache
$db->delete_query("datacache", $where);

Zeile 591Zeile 601
		while($forum_permission = $db->fetch_array($query))
{
$this->forum_permissions[$forum_permission['fid']][$forum_permission['gid']] = $forum_permission;

		while($forum_permission = $db->fetch_array($query))
{
$this->forum_permissions[$forum_permission['fid']][$forum_permission['gid']] = $forum_permission;

		}


		}


		$this->build_forum_permissions();
$this->update("forumpermissions", $this->built_forum_permissions);


		$this->build_forum_permissions();
$this->update("forumpermissions", $this->built_forum_permissions);


Zeile 1089Zeile 1099
		$this->update("most_viewed_threads", $threads);
}


		$this->update("most_viewed_threads", $threads);
}


 
	/**
* @deprecated
*/

	function update_banned()
{

	function update_banned()
{

		global $db;

$bans = array();

$query = $db->simple_select("banned");
while($ban = $db->fetch_array($query))
{
$bans[$ban['uid']] = $ban;
}

$this->update("banned", $bans);

		// "banned" cache removed











	}

function update_birthdays()

	}

function update_birthdays()