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 native_unserialize() over my_unserialize() for performance reasons $data = native_unserialize($cache_data['cache']);
// 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;
|
} } }
| } } }
|
Zeile 252 | Zeile 259 |
---|
// We ALWAYS keep a running copy in the db just incase we need it $dbcontents = $db->escape_string(my_serialize($contents));
|
// We ALWAYS keep a running copy in the db just incase we need it $dbcontents = $db->escape_string(my_serialize($contents));
|
|
|
$replace_array = array( "title" => $db->escape_string($name), "cache" => $dbcontents
| $replace_array = array( "title" => $db->escape_string($name), "cache" => $dbcontents
|
Zeile 260 | Zeile 267 |
---|
$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) { get_execution_time();
$hit = $this->handler->put($name, $contents);
$call_time = get_execution_time();
| if($this->handler instanceof CacheHandlerInterface) { get_execution_time();
$hit = $this->handler->put($name, $contents);
$call_time = get_execution_time();
|
$this->call_time += $call_time; $this->call_count++;
| $this->call_time += $call_time; $this->call_count++;
|
Zeile 307 | Zeile 314 |
---|
if($mybb->debug_mode) { $this->debug_call('delete:'.$name, $call_time, $hit);
|
if($mybb->debug_mode) { $this->debug_call('delete:'.$name, $call_time, $hit);
|
}
| }
|
}
// Greedy?
| }
// Greedy?
|
Zeile 471 | Zeile 478 |
---|
/** * Update the MyBB version in the cache.
|
/** * Update the MyBB version in the cache.
|
* */
| * */
|
function update_version() { global $mybb;
| function update_version() { global $mybb;
|
Zeile 490 | Zeile 497 |
---|
* */ function update_attachtypes()
|
* */ function update_attachtypes()
|
{ global $db;
$types = array();
| { global $db;
$types = array();
|
$query = $db->simple_select('attachtypes', '*', 'enabled=1'); while($type = $db->fetch_array($query)) { $type['extension'] = my_strtolower($type['extension']); $types[$type['extension']] = $type;
|
$query = $db->simple_select('attachtypes', '*', 'enabled=1'); while($type = $db->fetch_array($query)) { $type['extension'] = my_strtolower($type['extension']); $types[$type['extension']] = $type;
|
}
| }
|
$this->update("attachtypes", $types); }
| $this->update("attachtypes", $types); }
|
Zeile 514 | Zeile 521 |
---|
global $db;
$smilies = array();
|
global $db;
$smilies = array();
|
|
|
$query = $db->simple_select("smilies", "*", "", array('order_by' => 'disporder', 'order_dir' => 'ASC')); while($smilie = $db->fetch_array($query)) {
| $query = $db->simple_select("smilies", "*", "", array('order_by' => 'disporder', 'order_dir' => 'ASC')); while($smilie = $db->fetch_array($query)) {
|
Zeile 526 | Zeile 533 |
---|
/** * Update the posticon cache.
|
/** * Update the posticon cache.
|
* */
| * */
|
function update_posticons() { global $db;
| function update_posticons() { global $db;
|
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)
|