Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -r14692 -r14699 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 14692) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 14699) @@ -1,6 +1,6 @@ ModuleInfo as $module_name => $module_info) { - if (strtolower($module_info[$field]) == strtolower($value)) { + if ( strtolower($module_info[$field]) == strtolower($value) ) { $found = true; break; } } - if ($found) { + if ( $found ) { return isset($return_field) ? $module_info[$return_field] : $module_info; } @@ -463,6 +458,7 @@ return ; } + // use makeClass over recallObject, since used before kApplication initialization during installation $modules_helper =& $this->makeClass('ModulesHelper'); /* @var $modules_helper kModulesHelper */ @@ -745,7 +741,7 @@ $this->registerClass('kSocket', KERNEL_PATH . '/utility/socket.php', 'Socket'); // do not move to config - this helper is used before configs are read - $this->registerClass('kModulesHelper', KERNEL_PATH . '/../units/helpers/modules_helper.php', 'ModulesHelper'); + $this->registerClass('kModulesHelper', KERNEL_PATH . self::MODULE_HELPER_PATH, 'ModulesHelper'); } function RegisterDefaultBuildEvents() @@ -770,7 +766,8 @@ /** * Returns caching type (none, memory, temporary) * - * @return int + * @param int $caching_type + * @return bool * @access public */ public function isCachingType($caching_type) @@ -903,40 +900,29 @@ /** * Registers each module specific constants if any found * + * @return bool */ function registerModuleConstants() { - if (file_exists(KERNEL_PATH.'/constants.php')) { - kUtil::includeOnce(KERNEL_PATH.'/constants.php'); + if ( file_exists(KERNEL_PATH . '/constants.php') ) { + kUtil::includeOnce(KERNEL_PATH . '/constants.php'); } - if (!$this->ModuleInfo) { + if ( !$this->ModuleInfo ) { return false; } - foreach ($this->ModuleInfo as $module_name => $module_info) { + foreach ($this->ModuleInfo as $module_info) { $constants_file = FULL_PATH . '/' . $module_info['Path'] . 'constants.php'; - if (file_exists($constants_file)) { + if ( file_exists($constants_file) ) { kUtil::includeOnce($constants_file); } } return true; } - function ProcessRequest() - { - if ( defined('DEBUG_MODE') && $this->isDebugMode() && kUtil::constOn('DBG_SHOW_HTTPQUERY') ) { - $this->Debugger->appendHTML('HTTPQuery:'); - $this->Debugger->dumpVars($this->HttpQuery->_Params); - } - - $this->EventManager->ProcessRequest(); - $this->EventManager->runAgents(reBEFORE); - $this->RequestProcessed = true; - } - /** * Actually runs the parser against current template and stores parsing result * @@ -987,9 +973,7 @@ kUtil::safeDefine('EDITING_MODE', ''); // user can't edit anything $this->Phrases->setPhraseEditing(); - if ( !$this->RequestProcessed ) { - $this->ProcessRequest(); - } + $this->EventManager->ProcessRequest(); $this->InitParser(); $t = $this->GetVar('t'); @@ -1358,6 +1342,7 @@ * @param string $var HTTP Query (GPC) variable name * @param mixed $ses_var Session variable name * @param mixed $default Default variable value + * @param bool $optional */ function LinkVar($var, $ses_var = null, $default = '', $optional = false) { @@ -1413,11 +1398,11 @@ * Allows to parse given block name or include template * * @param Array $params Parameters to pass to block. Reserved parameter "name" used to specify block name. - * @param Array $pass_params Forces to pass current parser params to this block/template. Use with cauntion, because you can accidently pass "block_no_data" parameter. + * @param bool $pass_params Forces to pass current parser params to this block/template. Use with caution, because you can accidentally pass "block_no_data" parameter. * @param bool $as_template * @return string */ - function ParseBlock($params, $pass_params = 0, $as_template = false) + function ParseBlock($params, $pass_params = false, $as_template = false) { if (substr($params['name'], 0, 5) == 'html:') { return substr($params['name'], 5); @@ -1449,12 +1434,14 @@ } /** - * Return href for template - * - * @access public - * @param string $t Template path - * @var string $prefix index.php prefix - could be blank, 'admin' - */ + * Return href for template + * + * @param string $t Template path + * @param string $prefix index.php prefix - could be blank, 'admin' + * @param Array $params + * @param string $index_file + * @return string + */ public function HREF($t, $prefix = '', $params = null, $index_file = null) { return $this->UrlManager->HREF($t, $prefix, $params, $index_file); @@ -1925,7 +1912,7 @@ /** * Apply url rewriting used by mod_rewrite or not * - * @param bool $ssl Force ssl link to be build + * @param bool|null $ssl Force ssl link to be build * @return bool */ function RewriteURLs($ssl = false) @@ -1966,13 +1953,13 @@ * Set's new unit option value * * @param string $prefix - * @param string $name + * @param string $option * @param string $value * @access public */ public function setUnitOption($prefix, $option, $value) { - return $this->UnitConfigReader->setUnitOption($prefix,$option,$value); + $this->UnitConfigReader->setUnitOption($prefix,$option,$value); } /** @@ -2268,14 +2255,13 @@ } /** - * Returns genealogical main prefix for subtable prefix passes - * OR prefix, that has been found in REQUEST and some how is parent of passed subtable prefix + * Returns genealogical main prefix for sub-table prefix passes + * OR prefix, that has been found in REQUEST and some how is parent of passed sub-table prefix * * @param string $current_prefix - * @param string $real_top if set to true will return real topmost prefix, regardless of its id is passed or not + * @param bool $real_top if set to true will return real topmost prefix, regardless of its id is passed or not * @return string * @access public - * @author Kostja / Alex */ function GetTopmostPrefix($current_prefix, $real_top = false) { @@ -2486,6 +2472,7 @@ * Checks, that given prefix is in temp mode * * @param string $prefix + * @param string $special * @return bool */ function IsTempMode($prefix, $special = '')