Vergleich inc/class_datacache.php - 1.8.22 - 1.8.27

  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 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 354Zeile 364
	 * @param string $string The cache key
* @param string $qtime The time it took to perform the call.
* @param boolean $hit Hit or miss status

	 * @param string $string The cache key
* @param string $qtime The time it took to perform the call.
* @param boolean $hit Hit or miss status

	 */

	 */

	function debug_call($string, $qtime, $hit)
{
global $mybb, $plugins;

	function debug_call($string, $qtime, $hit)
{
global $mybb, $plugins;

Zeile 368Zeile 378
		if($hit)
{
$hit_status = 'HIT';

		if($hit)
{
$hit_status = 'HIT';

		}
else

		}
else

		{
$hit_status = 'MISS';
}

		{
$hit_status = 'MISS';
}





		$cache_data = explode(':', $string);
$cache_method = $cache_data[0];
$cache_key = $cache_data[1];

		$cache_data = explode(':', $string);
$cache_method = $cache_data[0];
$cache_key = $cache_data[1];

Zeile 384Zeile 394
</tr>
<tr style=\"background-color: #fefefe;\">
<td><span style=\"font-family: Courier; font-size: 14px;\">({$mybb->config['cache_store']}) [{$hit_status}] ".htmlspecialchars_uni($cache_key)."</span></td>

</tr>
<tr style=\"background-color: #fefefe;\">
<td><span style=\"font-family: Courier; font-size: 14px;\">({$mybb->config['cache_store']}) [{$hit_status}] ".htmlspecialchars_uni($cache_key)."</span></td>

</tr>

</tr>

<tr>
<td bgcolor=\"#ffffff\">Call Time: ".format_time_duration($qtime)."</td>
</tr>

<tr>
<td bgcolor=\"#ffffff\">Call Time: ".format_time_duration($qtime)."</td>
</tr>

Zeile 445Zeile 455
	 *
*/
function update_version()

	 *
*/
function update_version()

	{

	{

		global $mybb;

		global $mybb;





		$version = array(
"version" => $mybb->version,
"version_code" => $mybb->version_code

		$version = array(
"version" => $mybb->version,
"version_code" => $mybb->version_code

Zeile 455Zeile 465

$this->update("version", $version);
}


$this->update("version", $version);
}





	/**
* Update the attachment type cache.
*
*/
function update_attachtypes()

	/**
* Update the attachment type cache.
*
*/
function update_attachtypes()

	{
global $db;


	{
global $db;


		$types = array();

$query = $db->simple_select('attachtypes', '*', 'enabled=1');

		$types = array();

$query = $db->simple_select('attachtypes', '*', 'enabled=1');

Zeile 561Zeile 571
	{
global $forum_cache, $db;


	{
global $forum_cache, $db;


		$this->built_forum_permissions = array(0);

		$this->forum_permissions = $this->built_forum_permissions = array(0);


// Get our forum list
cache_forums(true);


// Get our forum list
cache_forums(true);

Zeile 618Zeile 628
					$perms = $permissions;
foreach($usergroups as $gid)
{

					$perms = $permissions;
foreach($usergroups as $gid)
{

						if($this->forum_permissions[$forum['fid']][$gid])

						if(isset($this->forum_permissions[$forum['fid']][$gid]) && $this->forum_permissions[$forum['fid']][$gid])

						{
$perms[$gid] = $this->forum_permissions[$forum['fid']][$gid];
}

						{
$perms[$gid] = $this->forum_permissions[$forum['fid']][$gid];
}

Zeile 676Zeile 686
		");

$most_posts = 0;

		");

$most_posts = 0;

 
		$topposter = array();

		while($user = $db->fetch_array($query))
{
if($user['poststoday'] > $most_posts)

		while($user = $db->fetch_array($query))
{
if($user['poststoday'] > $most_posts)

Zeile 836Zeile 847
					}
$this->built_moderators[$forum['fid']] = $forum_mods;
$this->build_moderators($forum_mods, $forum['fid']);

					}
$this->built_moderators[$forum['fid']] = $forum_mods;
$this->build_moderators($forum_mods, $forum['fid']);

				}
}

				}
}

		}
}


		}
}


Zeile 853Zeile 864

// Things we don't want to cache
$exclude = array("unapprovedthreads", "unapprovedposts", "threads", "posts", "lastpost", "lastposter", "lastposttid", "lastposteruid", "lastpostsubject", "deletedthreads", "deletedposts");


// Things we don't want to cache
$exclude = array("unapprovedthreads", "unapprovedposts", "threads", "posts", "lastpost", "lastposter", "lastposttid", "lastposteruid", "lastpostsubject", "deletedthreads", "deletedposts");





		$query = $db->simple_select("forums", "*", "", array('order_by' => 'pid,disporder'));
while($forum = $db->fetch_array($query))
{

		$query = $db->simple_select("forums", "*", "", array('order_by' => 'pid,disporder'));
while($forum = $db->fetch_array($query))
{

Zeile 868Zeile 879
		}

$this->update("forums", $forums);

		}

$this->update("forums", $forums);

	}

	}


/**
* Update usertitles cache.


/**
* Update usertitles cache.

Zeile 894Zeile 905
	 */
function update_reportedcontent()
{

	 */
function update_reportedcontent()
{

		global $db, $mybb;


		global $db;


		$query = $db->simple_select("reportedcontent", "COUNT(rid) AS unreadcount", "reportstatus='0'");

		$query = $db->simple_select("reportedcontent", "COUNT(rid) AS unreadcount", "reportstatus='0'");

		$num = $db->fetch_array($query);


		$unreadcount = $db->fetch_field($query, 'unreadcount');


		$query = $db->simple_select("reportedcontent", "COUNT(rid) AS reportcount");

		$query = $db->simple_select("reportedcontent", "COUNT(rid) AS reportcount");

		$total = $db->fetch_array($query);

$query = $db->simple_select("reportedcontent", "dateline", "reportstatus='0'", array('order_by' => 'dateline', 'order_dir' => 'DESC'));
$latest = $db->fetch_array($query);

		$reportcount = $db->fetch_field($query, 'reportcount');

$query = $db->simple_select("reportedcontent", "dateline", "reportstatus='0'", array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => 1));
$dateline = $db->fetch_field($query, 'dateline');


$reports = array(


$reports = array(

			"unread" => $num['unreadcount'],
"total" => $total['reportcount'],
"lastdateline" => $latest['dateline']

			'unread' => $unreadcount,
'total' => $reportcount,
'lastdateline' => $dateline,

		);

$this->update("reportedcontent", $reports);

		);

$this->update("reportedcontent", $reports);

Zeile 1089Zeile 1100
		$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()