aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-08-15 12:06:05 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-08-15 12:06:05 +0000
commit2706ce6534ea92c4d8caafeccd022ccd7479f969 (patch)
tree204a18c2279a6695ff716d9478610fac173003ff
parent5f8dc3ca0e454b33c695efe783981a8b77e5c18e (diff)
downloadforums-2706ce6534ea92c4d8caafeccd022ccd7479f969.tar
forums-2706ce6534ea92c4d8caafeccd022ccd7479f969.tar.gz
forums-2706ce6534ea92c4d8caafeccd022ccd7479f969.tar.bz2
forums-2706ce6534ea92c4d8caafeccd022ccd7479f969.tar.xz
forums-2706ce6534ea92c4d8caafeccd022ccd7479f969.zip
- fix huge memory hog. :) (how dumb i was... hmm...)
git-svn-id: file:///svn/phpbb/trunk@4962 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/session.php39
1 files changed, 15 insertions, 24 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 2fbfa153c3..32f1a0081b 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -538,9 +538,13 @@ class user extends session
}
}
+ // We include common language file here to not load it every time a custom language file is included
+ $lang = &$this->lang;
+ require($this->lang_path . "common.$phpEx");
+
$this->add_lang($lang_set);
unset($lang_set);
-
+
if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
{
global $SID;
@@ -644,11 +648,7 @@ class user extends session
// $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
function add_lang($lang_set, $use_db = false, $use_help = false)
{
- global $lang, $help, $phpEx;
-
- $lang = array();
-
- require($this->lang_path . "common.$phpEx");
+ global $phpEx;
if (is_array($lang_set))
{
@@ -668,7 +668,7 @@ class user extends session
}
else if (!is_array($lang_file))
{
- $this->set_lang($lang_file, $use_db, $use_help);
+ $this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help);
}
else
{
@@ -679,30 +679,21 @@ class user extends session
}
else if ($lang_set)
{
- $this->set_lang($lang_set, $use_db, $use_help);
- }
-
- if ($use_help || sizeof($help))
- {
- $this->help += $help;
- unset($help);
- }
-
- if (sizeof($lang))
- {
- $this->lang += $lang;
- // Yes, we unset $lang here, this variable is in use elsewhere
- unset($lang);
+ $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help);
}
}
- function set_lang($lang_file, $use_db = false, $use_help = false)
+ function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false)
{
- global $lang, $help, $phpEx;
+ global $phpEx;
+ // $lang == $this->lang
+ // $help == $this->help
+ // - add appropiate variables here, name them as they are used within the language file...
+
if (!$use_db)
{
- require ($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx");
+ require($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx");
}
else if ($use_db)
{