Zeile 134 | 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)) {
|
// use PHP's own unserialize() for performance reasons $this->cache[$data['title']] = unserialize($data['cache'], array('allowed_classes' => false));
| // use native_unserialize() over my_unserialize() for performance reasons $this->cache[$data['title']] = native_unserialize($data['cache']);
|
} } }
| } } }
|
Zeile 190 | Zeile 190 |
---|
$query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query);
|
$query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query);
|
// use PHP's own unserialize() for performance reasons $data = unserialize($cache_data['cache'], array('allowed_classes' => false));
// Update cache for handler get_execution_time();
| 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);
|
|
|
$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;
|
}
|
}
|
}
| }
|
} // Else, using internal database cache else { $query = $db->simple_select("datacache", "title,cache", "title='$name'"); $cache_data = $db->fetch_array($query);
|
} // Else, using internal database cache else { $query = $db->simple_select("datacache", "title,cache", "title='$name'"); $cache_data = $db->fetch_array($query);
|
|
|
if(empty($cache_data['title'])) { $data = false; } else {
|
if(empty($cache_data['title'])) { $data = false; } else {
|
// use PHP's own unserialize() for performance reasons $data = unserialize($cache_data['cache'], array('allowed_classes' => false));
| // use native_unserialize() over my_unserialize() for performance reasons $data = native_unserialize($cache_data['cache']);
|
} }
| } }
|
Zeile 229 | Zeile 236 |
---|
$this->cache[$name] = $data;
if($data !== false)
|
$this->cache[$name] = $data;
if($data !== false)
|
{
| {
|
return $data; } else
| return $data; } else
|
Zeile 256 | Zeile 263 |
---|
$replace_array = array( "title" => $db->escape_string($name), "cache" => $dbcontents
|
$replace_array = array( "title" => $db->escape_string($name), "cache" => $dbcontents
|
);
| );
|
$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?
|
Zeile 419 | Zeile 426 |
---|
</tr> </table> <br />\n";
|
</tr> </table> <br />\n";
|
|
|
$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; }
|
Zeile 637 | Zeile 644 |
---|
*/ private function build_forum_permissions($permissions=array(), $pid=0) {
|
*/ private function build_forum_permissions($permissions=array(), $pid=0) {
|
$usergroups = array_keys($this->read("usergroups", true));
| $usergroups = $this->read("usergroups", true);
if($usergroups === false) { $usergroups = array(); } $usergroups = array_keys($usergroups);
|
if(!empty($this->forum_permissions_forum_cache[$pid])) { foreach($this->forum_permissions_forum_cache[$pid] as $main)
| if(!empty($this->forum_permissions_forum_cache[$pid])) { foreach($this->forum_permissions_forum_cache[$pid] as $main)
|