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 native_unserialize() over my_unserialize() for performance reasons $this->cache[$data['title']] = native_unserialize($data['cache']);
|
} } }
| } } }
|
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']);
| |
|
|
// Update cache for handler get_execution_time();
$hit = $this->handler->put($name, $data);
| if($cache_data) { // use native_unserialize() over my_unserialize() for performance reasons $data = native_unserialize($cache_data['cache']);
// Update cache for handler get_execution_time();
$hit = $this->handler->put($name, $data);
|
|
|
$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++;
|
|
|
if($mybb->debug_mode)
| if($mybb->debug_mode) { $this->debug_call('set:'.$name, $call_time, $hit); } } else
|
{
|
{
|
$this->debug_call('set:'.$name, $call_time, $hit);
| $data = false;
|
} } }
| } } }
|
Zeile 202 | Zeile 227 |
---|
} else {
|
} else {
|
$data = unserialize($cache_data['cache']);
| // use native_unserialize() over my_unserialize() for performance reasons $data = native_unserialize($cache_data['cache']);
|
} }
| } }
|
Zeile 210 | Zeile 236 |
---|
$this->cache[$name] = $data;
if($data !== false)
|
$this->cache[$name] = $data;
if($data !== false)
|
{ return $data; } else { return false;
| { return $data; } else { return false;
|
} }
| } }
|
Zeile 366 | Zeile 392 |
---|
* @param boolean $hit Hit or miss status */ function debug_call($string, $qtime, $hit)
|
* @param boolean $hit Hit or miss status */ function debug_call($string, $qtime, $hit)
|
{
| {
|
global $mybb, $plugins;
|
global $mybb, $plugins;
|
|
|
$debug_extra = ''; if($plugins->current_hook) {
| $debug_extra = ''; if($plugins->current_hook) {
|
Zeile 376 | Zeile 402 |
---|
}
if($hit)
|
}
if($hit)
|
{
| {
|
$hit_status = 'HIT'; } else
| $hit_status = 'HIT'; } else
|
Zeile 404 | Zeile 430 |
---|
$this->calllist[$this->call_count]['key'] = $string; $this->calllist[$this->call_count]['time'] = $qtime; }
|
$this->calllist[$this->call_count]['key'] = $string; $this->calllist[$this->call_count]['time'] = $qtime; }
|
|
|
/** * Select the size of the cache *
| /** * Select the size of the cache *
|
Zeile 442 | Zeile 468 |
---|
{ $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"));
|
}
| }
|
else { return $db->fetch_size("datacache");
| else { return $db->fetch_size("datacache");
|
Zeile 666 | Zeile 692 |
---|
$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 1322 |
---|
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 1330 |
---|
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 1338 |
---|
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 1346 |
---|
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 1354 |
---|
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 1362 |
---|
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 1370 |
---|
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")));
|
} }
| } }
|