Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -N -r15130 -r15137 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15130) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15137) @@ -1,6 +1,6 @@ Conn =& $this->Factory->makeClass($db_class, Array (SQL_TYPE, Array (&$this, 'handleSQLError'))); + $this->Conn = $this->Factory->makeClass($db_class, Array (SQL_TYPE, Array (&$this, 'handleSQLError'))); $this->Conn->setup($vars); - $this->cacheManager =& $this->makeClass('kCacheManager'); + $this->cacheManager = $this->makeClass('kCacheManager'); $this->cacheManager->InitCache(); if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { $this->Debugger->appendTimestamp('Before UnitConfigReader'); } // init config reader and all managers - $this->UnitConfigReader =& $this->makeClass('kUnitConfigReader'); + $this->UnitConfigReader = $this->makeClass('kUnitConfigReader'); $this->UnitConfigReader->scanModules(MODULES_PATH); // will also set RewriteListeners when existing cache is read $this->registerModuleConstants(); @@ -343,14 +343,14 @@ define('MOD_REWRITE', $this->ConfigValue('UseModRewrite') && !$this->isAdmin ? 1 : 0); // start processing request - $this->HttpQuery =& $this->recallObject('HTTPQuery'); + $this->HttpQuery = $this->recallObject('HTTPQuery'); $this->HttpQuery->process(); if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { $this->Debugger->appendTimestamp('Processed HTTPQuery initial'); } - $this->Session =& $this->recallObject('Session'); + $this->Session = $this->recallObject('Session'); if ( defined('DEBUG_MODE') && $this->isDebugMode() ) { $this->Debugger->appendTimestamp('Processed Session'); @@ -398,7 +398,7 @@ $this->SetVar('visits_id', $visit_id); } - $language =& $this->recallObject('lang.current', null, Array ('live_table' => true)); + $language = $this->recallObject('lang.current', null, Array ('live_table' => true)); /* @var $language LanguagesItem */ if ( preg_match('/utf-8/', $language->GetDBField('Charset')) ) { @@ -431,9 +431,9 @@ return; } - $this->UrlManager =& $this->makeClass('kUrlManager'); - $this->EventManager =& $this->makeClass('EventManager'); - $this->Phrases =& $this->makeClass('kPhraseCache'); + $this->UrlManager = $this->makeClass('kUrlManager'); + $this->EventManager = $this->makeClass('EventManager'); + $this->Phrases = $this->makeClass('kPhraseCache'); $this->RegisterDefaultBuildEvents(); } @@ -478,7 +478,7 @@ } // use makeClass over recallObject, since used before kApplication initialization during installation - $modules_helper =& $this->makeClass('ModulesHelper'); + $modules_helper = $this->makeClass('ModulesHelper'); /* @var $modules_helper kModulesHelper */ $this->Conn->nextQueryCachable = true; @@ -511,7 +511,7 @@ $lang_mode = $this->GetVar('lang_mode'); $this->SetVar('lang_mode', ''); - $lang =& $this->recallObject('lang.current'); + $lang = $this->recallObject('lang.current'); /* @var $lang kDBItem */ if ( !$lang->isLoaded() || (!$this->isAdmin && !$lang->GetDBField('Enabled')) ) { @@ -569,7 +569,7 @@ $this->SetVar('m_theme', $theme_id); $this->SetVar('theme.current_id', $theme_id); // KOSTJA: this is to fool theme' getPassedID - $theme =& $this->recallObject('theme.current'); + $theme = $this->recallObject('theme.current'); /* @var $theme ThemeItem */ if ( !$theme->isLoaded() || !$theme->GetDBField('Enabled') ) { @@ -716,7 +716,7 @@ } if ( !$this->siteDomain ) { - $this->siteDomain =& $this->recallObject('site-domain.current'); + $this->siteDomain = $this->recallObject('site-domain.current'); /* @var $site_domain kDBItem */ } @@ -1064,7 +1064,7 @@ } } elseif ( $this->GetVar('admin') ) { - $admin_session =& $this->recallObject('Session.admin'); + $admin_session = $this->recallObject('Session.admin'); /* @var $admin_session Session */ // store Admin Console User's ID to Front-End's session for cross-session permission checks @@ -1086,7 +1086,7 @@ $t = $this->GetVar('render_template', $this->GetVar('t')); if ( !$this->TemplatesCache->TemplateExists($t) && !$this->isAdmin ) { - $cms_handler =& $this->recallObject('st_EventHandler'); + $cms_handler = $this->recallObject('st_EventHandler'); /* @var $cms_handler CategoriesEventHandler */ $t = ltrim($cms_handler->GetDesignTemplate(), '/'); @@ -1131,8 +1131,8 @@ public function InitParser($theme_name = false) { if ( !is_object($this->Parser) ) { - $this->Parser =& $this->recallObject('NParser'); - $this->TemplatesCache =& $this->recallObject('TemplatesCache'); + $this->Parser = $this->recallObject('NParser'); + $this->TemplatesCache = $this->recallObject('TemplatesCache'); } $this->TemplatesCache->forceThemeName = $theme_name; @@ -1173,7 +1173,7 @@ $this->HTML = ob_get_clean() . $this->HTML; } - $language =& $this->recallObject('lang.current'); + $language = $this->recallObject('lang.current'); /* @var $language LanguagesItem */ // don't replace header if some tag (e.g. XMLTemplate) already set it to something else @@ -1333,7 +1333,7 @@ */ public function GetSID() { - $session =& $this->recallObject('Session'); + $session = $this->recallObject('Session'); /* @var $session Session */ return $session->GetID(); @@ -1348,7 +1348,7 @@ */ public function DestroySession() { - $session =& $this->recallObject('Session'); + $session = $this->recallObject('Session'); /* @var $session Session */ $session->Destroy(); @@ -1505,7 +1505,7 @@ */ public function StoreVar($var, $val, $optional = false) { - $session =& $this->recallObject('Session'); + $session = $this->recallObject('Session'); /* @var $session Session */ $this->Session->StoreVar($var, $val, $optional); @@ -1538,7 +1538,7 @@ */ public function StoreVarDefault($var, $val, $optional = false) { - $session =& $this->recallObject('Session'); + $session = $this->recallObject('Session'); /* @var $session Session */ $this->Session->StoreVarDefault($var, $val, $optional); @@ -1878,7 +1878,7 @@ // session expiration is called from session initialization, // that's why $this->Session may be not defined here - $session =& $this->recallObject('Session'); + $session = $this->recallObject('Session'); /* @var $session Session */ $this->HandleEvent(new kEvent('adm:OnBeforeShutdown')); @@ -1926,7 +1926,7 @@ */ protected function ValidateLogin() { - $session =& $this->recallObject('Session'); + $session = $this->recallObject('Session'); /* @var $session Session */ $user_id = $session->GetField('PortalUserId'); @@ -1948,7 +1948,7 @@ if ( $this->GetVar('expired') == 1 ) { // this parameter is set only from admin - $user =& $this->recallObject('u.login-admin', null, Array ('form_name' => 'login')); + $user = $this->recallObject('u.login-admin', null, Array ('form_name' => 'login')); /* @var $user UsersItem */ $user->SetError('UserLogin', 'session_expired', 'la_text_sess_expired'); @@ -2102,7 +2102,7 @@ */ public function registerAggregateTag($tag_info) { - $aggregator =& $this->recallObject('TagsAggregator', 'kArray'); + $aggregator = $this->recallObject('TagsAggregator', 'kArray'); /* @var $aggregator kArray */ $tag_data = Array ( @@ -2123,16 +2123,14 @@ * @param Array $arguments * @return kBase */ - public function &recallObject($name, $pseudo_class = null, $event_params = Array(), $arguments = Array ()) + public function recallObject($name, $pseudo_class = null, $event_params = Array(), $arguments = Array ()) { /*if ( !$this->hasObject($name) && $this->isDebugMode() && ($name == '_prefix_here_') ) { // first time, when object with "_prefix_here_" prefix is accessed $this->Debugger->appendTrace(); }*/ - $result =& $this->Factory->getObject($name, $pseudo_class, $event_params, $arguments); - - return $result; + return $this->Factory->getObject($name, $pseudo_class, $event_params, $arguments); } /** @@ -2142,12 +2140,11 @@ * @return kDBTagProcessor * @access public */ - public function &recallTagProcessor($prefix) + public function recallTagProcessor($prefix) { $this->InitParser(); // because kDBTagProcesor is in NParser dependencies - $result =& $this->recallObject($prefix . '_TagProcessor'); - return $result; + return $this->recallObject($prefix . '_TagProcessor'); } /** @@ -2184,11 +2181,9 @@ * @return kBase * @access public */ - public function &makeClass($pseudo_class, $arguments = Array ()) + public function makeClass($pseudo_class, $arguments = Array ()) { - $result =& $this->Factory->makeClass($pseudo_class, $arguments); - - return $result; + return $this->Factory->makeClass($pseudo_class, $arguments); } /** @@ -2682,7 +2677,7 @@ */ public function CheckPermission($name, $type = 1, $cat_id = null) { - $perm_helper =& $this->recallObject('PermissionsHelper'); + $perm_helper = $this->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ return $perm_helper->CheckPermission($name, $type, $cat_id); @@ -2699,7 +2694,7 @@ */ public function CheckAdminPermission($name, $type = 1, $cat_id = null) { - $perm_helper =& $this->recallObject('PermissionsHelper'); + $perm_helper = $this->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ return $perm_helper->CheckAdminPermission($name, $type, $cat_id); @@ -2721,7 +2716,7 @@ return; } - $visit =& $this->recallObject('visits', null, Array ('raise_warnings' => 0)); + $visit = $this->recallObject('visits', null, Array ('raise_warnings' => 0)); /* @var $visit kDBItem */ if ( $visit->isLoaded() ) { @@ -2968,7 +2963,7 @@ */ public function getCounter($name, $params = Array (), $query_name = null, $multiple_results = false) { - $count_helper =& $this->recallObject('CountHelper'); + $count_helper = $this->recallObject('CountHelper'); /* @var $count_helper kCountHelper */ return $count_helper->getCounter($name, $params, $query_name, $multiple_results); @@ -2987,7 +2982,7 @@ return; } - $count_helper =& $this->recallObject('CountHelper'); + $count_helper = $this->recallObject('CountHelper'); /* @var $count_helper kCountHelper */ $count_helper->resetCounters($tables); @@ -3003,7 +2998,7 @@ */ public function XMLHeader($xml_version = false) { - $lang =& $this->recallObject('lang.current'); + $lang = $this->recallObject('lang.current'); /* @var $lang LanguagesItem */ header('Content-type: text/xml; charset=' . $lang->GetDBField('Charset'));