Zeile 51 | Zeile 51 |
---|
* @var string */ public $cache_debug;
|
* @var string */ public $cache_debug;
|
| /** * @var array */ public $moderators;
/** * @var array */ public $built_moderators;
/** * @var array */ public $moderators_forum_cache;
|
/** * Build cache data.
| /** * Build cache data.
|
Zeile 119 | Zeile 134 |
---|
$query = $db->simple_select("datacache", "title,cache"); while($data = $db->fetch_array($query)) {
|
$query = $db->simple_select("datacache", "title,cache"); while($data = $db->fetch_array($query)) {
|
$this->cache[$data['title']] = unserialize($data['cache']);
| // use PHP's own unserialize() for performance reasons $this->cache[$data['title']] = unserialize($data['cache'], array('allowed_classes' => false));
|
} } }
| } } }
|
Zeile 130 | Zeile 146 |
---|
* @param string $name The cache component to read. * @param boolean $hard If true, cannot be overwritten during script execution. * @return mixed
|
* @param string $name The cache component to read. * @param boolean $hard If true, cannot be overwritten during script execution. * @return mixed
|
*/
| */
|
function read($name, $hard=false) { global $db, $mybb;
| function read($name, $hard=false) { global $db, $mybb;
|
Zeile 146 | Zeile 162 |
---|
{ return false; }
|
{ return false; }
|
|
|
if($this->handler instanceof CacheHandlerInterface) { get_execution_time();
| if($this->handler instanceof CacheHandlerInterface) { get_execution_time();
|
Zeile 173 | Zeile 189 |
---|
// Fetch from database $query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query);
|
// Fetch from database $query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query);
|
$data = my_unserialize($cache_data['cache']);
| // use PHP's own unserialize() for performance reasons $data = unserialize($cache_data['cache'], array('allowed_classes' => false));
|
// Update cache for handler get_execution_time();
| // Update cache for handler get_execution_time();
|
Zeile 202 | Zeile 220 |
---|
} else {
|
} else {
|
$data = unserialize($cache_data['cache']);
| // use PHP's own unserialize() for performance reasons $data = unserialize($cache_data['cache'], array('allowed_classes' => false));
|
} }
| } }
|
Zeile 286 | Zeile 305 |
---|
$this->call_count++;
if($mybb->debug_mode)
|
$this->call_count++;
if($mybb->debug_mode)
|
{
| {
|
$this->debug_call('delete:'.$name, $call_time, $hit); } }
| $this->debug_call('delete:'.$name, $call_time, $hit); } }
|
Zeile 439 | Zeile 458 |
---|
else { if($name)
|
else { if($name)
|
{
| {
|
$query = $db->simple_select("datacache", "cache", "title='{$name}'"); return strlen($db->fetch_field($query, "cache")); }
| $query = $db->simple_select("datacache", "cache", "title='{$name}'"); return strlen($db->fetch_field($query, "cache")); }
|
Zeile 593 | Zeile 612 |
---|
foreach($fcache as $pid => $value) { ksort($fcache[$pid]);
|
foreach($fcache as $pid => $value) { ksort($fcache[$pid]);
|
}
| }
|
ksort($fcache);
|
ksort($fcache);
|
|
|
// Fetch forum permissions from the database $query = $db->simple_select("forumpermissions"); while($forum_permission = $db->fetch_array($query)) { $this->forum_permissions[$forum_permission['fid']][$forum_permission['gid']] = $forum_permission;
|
// Fetch forum permissions from the database $query = $db->simple_select("forumpermissions"); 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);
|
|
|
return true; }
/** * Build the forum permissions array
|
return true; }
/** * Build the forum permissions array
|
*
| *
|
* @access private * @param array $permissions An optional permissions array. * @param int $pid An optional permission id.
| * @access private * @param array $permissions An optional permissions array. * @param int $pid An optional permission id.
|
Zeile 620 | Zeile 639 |
---|
{ $usergroups = array_keys($this->read("usergroups", true)); if(!empty($this->forum_permissions_forum_cache[$pid]))
|
{ $usergroups = array_keys($this->read("usergroups", true)); if(!empty($this->forum_permissions_forum_cache[$pid]))
|
{
| {
|
foreach($this->forum_permissions_forum_cache[$pid] as $main) { foreach($main as $forum)
| foreach($this->forum_permissions_forum_cache[$pid] as $main) { foreach($main as $forum)
|
Zeile 629 | Zeile 648 |
---|
foreach($usergroups as $gid) { if(isset($this->forum_permissions[$forum['fid']][$gid]) && $this->forum_permissions[$forum['fid']][$gid])
|
foreach($usergroups as $gid) { if(isset($this->forum_permissions[$forum['fid']][$gid]) && $this->forum_permissions[$forum['fid']][$gid])
|
{
| {
|
$perms[$gid] = $this->forum_permissions[$forum['fid']][$gid]; } if(!empty($perms[$gid]))
| $perms[$gid] = $this->forum_permissions[$forum['fid']][$gid]; } if(!empty($perms[$gid]))
|
Zeile 646 | Zeile 665 |
---|
/** * Update the stats cache (kept for the sake of being able to rebuild this cache via the cache interface)
|
/** * Update the stats cache (kept for the sake of being able to rebuild this cache via the cache interface)
|
* */
| * */
|
function update_stats() { require_once MYBB_ROOT."inc/functions_rebuild.php";
| function update_stats() { require_once MYBB_ROOT."inc/functions_rebuild.php";
|
Zeile 666 | Zeile 685 |
---|
$topreferrer = $db->fetch_array($query);
$timesearch = TIME_NOW - 86400;
|
$topreferrer = $db->fetch_array($query);
$timesearch = TIME_NOW - 86400;
|
switch($db->type) { case 'pgsql': $group_by = $db->build_fields_string('users', 'u.'); break; default: $group_by = 'p.uid'; break; }
| |
$query = $db->query(" SELECT u.uid, u.username, COUNT(*) AS poststoday FROM {$db->table_prefix}posts p LEFT JOIN {$db->table_prefix}users u ON (p.uid=u.uid) WHERE p.dateline > {$timesearch} AND p.visible=1
|
$query = $db->query(" SELECT u.uid, u.username, COUNT(*) AS poststoday FROM {$db->table_prefix}posts p LEFT JOIN {$db->table_prefix}users u ON (p.uid=u.uid) WHERE p.dateline > {$timesearch} AND p.visible=1
|
GROUP BY {$group_by}
| GROUP BY u.uid, u.username
|
ORDER BY poststoday DESC ");
| ORDER BY poststoday DESC ");
|
Zeile 1305 | Zeile 1315 |
---|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='mostonline'");
|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='mostonline'");
|
$this->update("mostonline", unserialize($db->fetch_field($query, "cache")));
| $this->update("mostonline", my_unserialize($db->fetch_field($query, "cache")));
|
}
function reload_plugins()
| }
function reload_plugins()
|
Zeile 1313 | Zeile 1323 |
---|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='plugins'");
|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='plugins'");
|
$this->update("plugins", unserialize($db->fetch_field($query, "cache")));
| $this->update("plugins", my_unserialize($db->fetch_field($query, "cache")));
|
}
function reload_last_backup()
| }
function reload_last_backup()
|
Zeile 1321 | Zeile 1331 |
---|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='last_backup'");
|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='last_backup'");
|
$this->update("last_backup", unserialize($db->fetch_field($query, "cache")));
| $this->update("last_backup", my_unserialize($db->fetch_field($query, "cache")));
|
}
function reload_internal_settings()
| }
function reload_internal_settings()
|
Zeile 1329 | Zeile 1339 |
---|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='internal_settings'");
|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='internal_settings'");
|
$this->update("internal_settings", unserialize($db->fetch_field($query, "cache")));
| $this->update("internal_settings", my_unserialize($db->fetch_field($query, "cache")));
|
}
function reload_version_history()
| }
function reload_version_history()
|
Zeile 1337 | Zeile 1347 |
---|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='version_history'");
|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='version_history'");
|
$this->update("version_history", unserialize($db->fetch_field($query, "cache")));
| $this->update("version_history", my_unserialize($db->fetch_field($query, "cache")));
|
}
function reload_modnotes()
| }
function reload_modnotes()
|
Zeile 1345 | Zeile 1355 |
---|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='modnotes'");
|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='modnotes'");
|
$this->update("modnotes", unserialize($db->fetch_field($query, "cache")));
| $this->update("modnotes", my_unserialize($db->fetch_field($query, "cache")));
|
}
function reload_adminnotes()
| }
function reload_adminnotes()
|
Zeile 1353 | Zeile 1363 |
---|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='adminnotes'");
|
global $db;
$query = $db->simple_select("datacache", "title,cache", "title='adminnotes'");
|
$this->update("adminnotes", unserialize($db->fetch_field($query, "cache")));
| $this->update("adminnotes", my_unserialize($db->fetch_field($query, "cache")));
|
} }
| } }
|