changed the cache files to save some memory (all global ones are hold in memory, doubling it).

git-svn-id: file:///svn/phpbb/trunk@7386 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-04-22 18:09:03 +00:00
parent 5742dcd68a
commit 5cb586461b
10 changed files with 34 additions and 26 deletions

View file

@ -227,7 +227,7 @@ foreach ($prefixes as $prefix)
$sql = 'UPDATE ' . USERS_TABLE . " SET user_permissions = ''";
$db->sql_query($sql);
$cache->destroy('acl_options');
$cache->destroy('_acl_options');
echo "<p><b>Done</b></p>\n";

View file

@ -15,8 +15,10 @@ phpBB Lead Developers : Acyd Burn (Meik Sievertsen)
psoTFX (Paul S. Owen) [2001 - 09/2005]
phpBB Developers : DavidMJ (David M.)
kellanved (Henry Sudhof)
naderman (Nils Adermann)
subBlue (Tom Beddard)
Vic (Vic D'elfant)
BartVB (Bart van Bragt) - [11/2000 - 03/2006]
Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - 10/2006]

View file

@ -50,7 +50,7 @@ class acp_bots
$db->sql_query($sql);
}
$cache->destroy('bots');
$cache->destroy('_bots');
break;
case 'deactivate':
@ -64,7 +64,7 @@ class acp_bots
$db->sql_query($sql);
}
$cache->destroy('bots');
$cache->destroy('_bots');
break;
case 'delete':
@ -107,7 +107,7 @@ class acp_bots
$db->sql_transaction('commit');
$cache->destroy('bots');
$cache->destroy('_bots');
add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action));
@ -250,7 +250,7 @@ class acp_bots
$log = 'UPDATED';
}
$cache->destroy('bots');
$cache->destroy('_bots');
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"));

View file

@ -285,7 +285,7 @@ class acp_icons
}
}
$cache->destroy('icons');
$cache->destroy('_icons');
$cache->destroy('sql', $table);
if ($action == 'modify')
@ -446,7 +446,7 @@ class acp_icons
}
}
$cache->destroy('icons');
$cache->destroy('_icons');
$cache->destroy('sql', $table);
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
@ -565,7 +565,7 @@ class acp_icons
$notice = $user->lang[$lang . '_DELETED'];
$cache->destroy('icons');
$cache->destroy('_icons');
$cache->destroy('sql', $table);
}
else
@ -617,7 +617,7 @@ class acp_icons
$db->sql_query($sql);
}
$cache->destroy('icons');
$cache->destroy('_icons');
$cache->destroy('sql', $table);
break;

View file

@ -74,7 +74,7 @@ class acp_ranks
}
$db->sql_query($sql);
$cache->destroy('ranks');
$cache->destroy('_ranks');
trigger_error($message . adm_back_link($this->u_action));
@ -105,7 +105,7 @@ class acp_ranks
WHERE user_rank = $rank_id";
$db->sql_query($sql);
$cache->destroy('ranks');
$cache->destroy('_ranks');
add_log('admin', 'LOG_RANK_REMOVED', $rank_title);
}

View file

@ -91,7 +91,7 @@ class acp_words
$db->sql_query('INSERT INTO ' . WORDS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
}
$cache->destroy('word_censors');
$cache->destroy('_word_censors');
$log_action = ($word_id) ? 'LOG_WORD_EDIT' : 'LOG_WORD_ADD';
add_log('admin', $log_action, $word);
@ -123,7 +123,7 @@ class acp_words
WHERE word_id = $word_id";
$db->sql_query($sql);
$cache->destroy('word_censors');
$cache->destroy('_word_censors');
add_log('admin', 'LOG_WORD_DELETE', $deleted_word);

View file

@ -30,7 +30,7 @@ class auth_admin extends auth
{
global $db, $cache;
if (($this->acl_options = $cache->get('acl_options')) === false)
if (($this->acl_options = $cache->get('_acl_options')) === false)
{
$sql = 'SELECT auth_option, is_global, is_local
FROM ' . ACL_OPTIONS_TABLE . '
@ -53,7 +53,7 @@ class auth_admin extends auth
}
$db->sql_freeresult($result);
$cache->put('acl_options', $this->acl_options);
$cache->put('_acl_options', $this->acl_options);
}
if (!sizeof($this->option_ids))
@ -761,7 +761,7 @@ class auth_admin extends auth
$db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary);
$cache->destroy('acl_options');
$cache->destroy('_acl_options');
$this->acl_clear_prefetch();
return true;

View file

@ -29,7 +29,7 @@ class auth
$this->acl = $this->cache = $this->acl_options = array();
$this->acl_forum_ids = false;
if (($this->acl_options = $cache->get('acl_options')) === false)
if (($this->acl_options = $cache->get('_acl_options')) === false)
{
$sql = 'SELECT auth_option, is_global, is_local
FROM ' . ACL_OPTIONS_TABLE . '
@ -52,7 +52,7 @@ class auth
}
$db->sql_freeresult($result);
$cache->put('acl_options', $this->acl_options);
$cache->put('_acl_options', $this->acl_options);
$this->acl_cache($userdata);
}
else if (!trim($userdata['user_permissions']))

View file

@ -79,7 +79,7 @@ class cache extends acm
return array();
}
if (($censors = $this->get('word_censors')) === false)
if (($censors = $this->get('_word_censors')) === false)
{
$sql = 'SELECT word, replacement
FROM ' . WORDS_TABLE;
@ -93,7 +93,7 @@ class cache extends acm
}
$db->sql_freeresult($result);
$this->put('word_censors', $censors);
$this->put('_word_censors', $censors);
}
return $censors;
@ -104,7 +104,7 @@ class cache extends acm
*/
function obtain_icons()
{
if (($icons = $this->get('icons')) === false)
if (($icons = $this->get('_icons')) === false)
{
global $db;
@ -124,7 +124,7 @@ class cache extends acm
}
$db->sql_freeresult($result);
$this->put('icons', $icons);
$this->put('_icons', $icons);
}
return $icons;
@ -135,7 +135,7 @@ class cache extends acm
*/
function obtain_ranks()
{
if (($ranks = $this->get('ranks')) === false)
if (($ranks = $this->get('_ranks')) === false)
{
global $db;
@ -165,7 +165,7 @@ class cache extends acm
}
$db->sql_freeresult($result);
$this->put('ranks', $ranks);
$this->put('_ranks', $ranks);
}
return $ranks;
@ -285,7 +285,7 @@ class cache extends acm
*/
function obtain_bots()
{
if (($bots = $this->get('bots')) === false)
if (($bots = $this->get('_bots')) === false)
{
global $db;
@ -323,7 +323,7 @@ class cache extends acm
}
$db->sql_freeresult($result);
$this->put('bots', $bots);
$this->put('_bots', $bots);
}
return $bots;

View file

@ -3968,6 +3968,12 @@ function page_header($page_title = '', $display_online_list = true)
'SITE_LOGO_IMG' => $user->img('site_logo'))
);
// Once used, we do not want to have the whole theme data twice in memory...
if ($user->theme['theme_storedb'])
{
$user->theme['theme_data'] = '';
}
// application/xhtml+xml not used because of IE
header('Content-type: text/html; charset=UTF-8');