mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
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:
parent
5742dcd68a
commit
5cb586461b
10 changed files with 34 additions and 26 deletions
|
@ -227,7 +227,7 @@ foreach ($prefixes as $prefix)
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . " SET user_permissions = ''";
|
$sql = 'UPDATE ' . USERS_TABLE . " SET user_permissions = ''";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$cache->destroy('acl_options');
|
$cache->destroy('_acl_options');
|
||||||
|
|
||||||
echo "<p><b>Done</b></p>\n";
|
echo "<p><b>Done</b></p>\n";
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,10 @@ phpBB Lead Developers : Acyd Burn (Meik Sievertsen)
|
||||||
psoTFX (Paul S. Owen) [2001 - 09/2005]
|
psoTFX (Paul S. Owen) [2001 - 09/2005]
|
||||||
|
|
||||||
phpBB Developers : DavidMJ (David M.)
|
phpBB Developers : DavidMJ (David M.)
|
||||||
|
kellanved (Henry Sudhof)
|
||||||
naderman (Nils Adermann)
|
naderman (Nils Adermann)
|
||||||
subBlue (Tom Beddard)
|
subBlue (Tom Beddard)
|
||||||
|
Vic (Vic D'elfant)
|
||||||
|
|
||||||
BartVB (Bart van Bragt) - [11/2000 - 03/2006]
|
BartVB (Bart van Bragt) - [11/2000 - 03/2006]
|
||||||
Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - 10/2006]
|
Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - 10/2006]
|
||||||
|
|
|
@ -50,7 +50,7 @@ class acp_bots
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('bots');
|
$cache->destroy('_bots');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'deactivate':
|
case 'deactivate':
|
||||||
|
@ -64,7 +64,7 @@ class acp_bots
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('bots');
|
$cache->destroy('_bots');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'delete':
|
case 'delete':
|
||||||
|
@ -107,7 +107,7 @@ class acp_bots
|
||||||
|
|
||||||
$db->sql_transaction('commit');
|
$db->sql_transaction('commit');
|
||||||
|
|
||||||
$cache->destroy('bots');
|
$cache->destroy('_bots');
|
||||||
|
|
||||||
add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
|
add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
|
||||||
trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action));
|
trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action));
|
||||||
|
@ -250,7 +250,7 @@ class acp_bots
|
||||||
$log = 'UPDATED';
|
$log = 'UPDATED';
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('bots');
|
$cache->destroy('_bots');
|
||||||
|
|
||||||
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
|
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
|
||||||
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"));
|
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"));
|
||||||
|
|
|
@ -285,7 +285,7 @@ class acp_icons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('icons');
|
$cache->destroy('_icons');
|
||||||
$cache->destroy('sql', $table);
|
$cache->destroy('sql', $table);
|
||||||
|
|
||||||
if ($action == 'modify')
|
if ($action == 'modify')
|
||||||
|
@ -446,7 +446,7 @@ class acp_icons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('icons');
|
$cache->destroy('_icons');
|
||||||
$cache->destroy('sql', $table);
|
$cache->destroy('sql', $table);
|
||||||
|
|
||||||
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
|
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'];
|
$notice = $user->lang[$lang . '_DELETED'];
|
||||||
|
|
||||||
$cache->destroy('icons');
|
$cache->destroy('_icons');
|
||||||
$cache->destroy('sql', $table);
|
$cache->destroy('sql', $table);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -617,7 +617,7 @@ class acp_icons
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('icons');
|
$cache->destroy('_icons');
|
||||||
$cache->destroy('sql', $table);
|
$cache->destroy('sql', $table);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -74,7 +74,7 @@ class acp_ranks
|
||||||
}
|
}
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$cache->destroy('ranks');
|
$cache->destroy('_ranks');
|
||||||
|
|
||||||
trigger_error($message . adm_back_link($this->u_action));
|
trigger_error($message . adm_back_link($this->u_action));
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class acp_ranks
|
||||||
WHERE user_rank = $rank_id";
|
WHERE user_rank = $rank_id";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$cache->destroy('ranks');
|
$cache->destroy('_ranks');
|
||||||
|
|
||||||
add_log('admin', 'LOG_RANK_REMOVED', $rank_title);
|
add_log('admin', 'LOG_RANK_REMOVED', $rank_title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ class acp_words
|
||||||
$db->sql_query('INSERT INTO ' . WORDS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
|
$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';
|
$log_action = ($word_id) ? 'LOG_WORD_EDIT' : 'LOG_WORD_ADD';
|
||||||
add_log('admin', $log_action, $word);
|
add_log('admin', $log_action, $word);
|
||||||
|
@ -123,7 +123,7 @@ class acp_words
|
||||||
WHERE word_id = $word_id";
|
WHERE word_id = $word_id";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$cache->destroy('word_censors');
|
$cache->destroy('_word_censors');
|
||||||
|
|
||||||
add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
|
add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class auth_admin extends auth
|
||||||
{
|
{
|
||||||
global $db, $cache;
|
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
|
$sql = 'SELECT auth_option, is_global, is_local
|
||||||
FROM ' . ACL_OPTIONS_TABLE . '
|
FROM ' . ACL_OPTIONS_TABLE . '
|
||||||
|
@ -53,7 +53,7 @@ class auth_admin extends auth
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$cache->put('acl_options', $this->acl_options);
|
$cache->put('_acl_options', $this->acl_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sizeof($this->option_ids))
|
if (!sizeof($this->option_ids))
|
||||||
|
@ -761,7 +761,7 @@ class auth_admin extends auth
|
||||||
|
|
||||||
$db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary);
|
$db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary);
|
||||||
|
|
||||||
$cache->destroy('acl_options');
|
$cache->destroy('_acl_options');
|
||||||
$this->acl_clear_prefetch();
|
$this->acl_clear_prefetch();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -29,7 +29,7 @@ class auth
|
||||||
$this->acl = $this->cache = $this->acl_options = array();
|
$this->acl = $this->cache = $this->acl_options = array();
|
||||||
$this->acl_forum_ids = false;
|
$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
|
$sql = 'SELECT auth_option, is_global, is_local
|
||||||
FROM ' . ACL_OPTIONS_TABLE . '
|
FROM ' . ACL_OPTIONS_TABLE . '
|
||||||
|
@ -52,7 +52,7 @@ class auth
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$cache->put('acl_options', $this->acl_options);
|
$cache->put('_acl_options', $this->acl_options);
|
||||||
$this->acl_cache($userdata);
|
$this->acl_cache($userdata);
|
||||||
}
|
}
|
||||||
else if (!trim($userdata['user_permissions']))
|
else if (!trim($userdata['user_permissions']))
|
||||||
|
|
|
@ -79,7 +79,7 @@ class cache extends acm
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($censors = $this->get('word_censors')) === false)
|
if (($censors = $this->get('_word_censors')) === false)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT word, replacement
|
$sql = 'SELECT word, replacement
|
||||||
FROM ' . WORDS_TABLE;
|
FROM ' . WORDS_TABLE;
|
||||||
|
@ -93,7 +93,7 @@ class cache extends acm
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$this->put('word_censors', $censors);
|
$this->put('_word_censors', $censors);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $censors;
|
return $censors;
|
||||||
|
@ -104,7 +104,7 @@ class cache extends acm
|
||||||
*/
|
*/
|
||||||
function obtain_icons()
|
function obtain_icons()
|
||||||
{
|
{
|
||||||
if (($icons = $this->get('icons')) === false)
|
if (($icons = $this->get('_icons')) === false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ class cache extends acm
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$this->put('icons', $icons);
|
$this->put('_icons', $icons);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $icons;
|
return $icons;
|
||||||
|
@ -135,7 +135,7 @@ class cache extends acm
|
||||||
*/
|
*/
|
||||||
function obtain_ranks()
|
function obtain_ranks()
|
||||||
{
|
{
|
||||||
if (($ranks = $this->get('ranks')) === false)
|
if (($ranks = $this->get('_ranks')) === false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ class cache extends acm
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$this->put('ranks', $ranks);
|
$this->put('_ranks', $ranks);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ranks;
|
return $ranks;
|
||||||
|
@ -285,7 +285,7 @@ class cache extends acm
|
||||||
*/
|
*/
|
||||||
function obtain_bots()
|
function obtain_bots()
|
||||||
{
|
{
|
||||||
if (($bots = $this->get('bots')) === false)
|
if (($bots = $this->get('_bots')) === false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ class cache extends acm
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$this->put('bots', $bots);
|
$this->put('_bots', $bots);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $bots;
|
return $bots;
|
||||||
|
|
|
@ -3968,6 +3968,12 @@ function page_header($page_title = '', $display_online_list = true)
|
||||||
'SITE_LOGO_IMG' => $user->img('site_logo'))
|
'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
|
// application/xhtml+xml not used because of IE
|
||||||
header('Content-type: text/html; charset=UTF-8');
|
header('Content-type: text/html; charset=UTF-8');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue