Index: branches/unlabeled/unlabeled-1.37.2/kernel/startup.php
===================================================================
diff -u -r4079 -r4178
--- branches/unlabeled/unlabeled-1.37.2/kernel/startup.php (.../startup.php) (revision 4079)
+++ branches/unlabeled/unlabeled-1.37.2/kernel/startup.php (.../startup.php) (revision 4178)
@@ -11,7 +11,9 @@
if( defined('REL_PATH') )
{
$ps = preg_replace("/".preg_quote(rtrim(REL_PATH, '/'), '/')."$/", '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])));
- safeDefine('BASE_PATH', $ps); // in case in-portal has defined it before
+ if (!defined('BASE_PATH')) {
+ define('BASE_PATH', $ps); // in case in-portal has defined it before
+ }
# New path detection method: end
// KENEL4 INIT: BEGIN
@@ -31,7 +33,8 @@
$application =& kApplication::Instance();
$application->Init();
-
+ $application->ProcessRequest();
+
// compatibility constants
$g_TablePrefix = TABLE_PREFIX;
$pathtoroot = FULL_PATH.'/';
Index: branches/unlabeled/unlabeled-1.21.2/core/kernel/globals.php
===================================================================
diff -u -r4086 -r4178
--- branches/unlabeled/unlabeled-1.21.2/core/kernel/globals.php (.../globals.php) (revision 4086)
+++ branches/unlabeled/unlabeled-1.21.2/core/kernel/globals.php (.../globals.php) (revision 4178)
@@ -37,51 +37,51 @@
return $return;
}
- if (!function_exists('print_pre')) {
- /**
- * Same as print_r, budet designed for viewing in web page
- *
- * @param Array $data
- * @param string $label
- */
- function print_pre($data, $label='')
+ /**
+ * Same as print_r, budet designed for viewing in web page
+ *
+ * @param Array $data
+ * @param string $label
+ */
+ function print_pre($data, $label='')
+ {
+ $is_debug = false;
+ if (class_exists('kApplication')) {
+ $application =& kApplication::Instance();
+ $is_debug = $application->isDebugMode();
+ }
+
+ if ($is_debug) {
+ if ($label) $application->Debugger->appendHTML(''.$label.'');
+ $application->Debugger->dumpVars($data);
+ }
+ else
{
- if( constOn('DEBUG_MODE') )
- {
- global $debugger;
- if($label) $debugger->appendHTML(''.$label.'');
- $debugger->dumpVars($data);
- }
- else
- {
- if($label) echo '',$label,'
';
- echo '
',print_r($data,true),''; - } + if ($label) echo '', $label, '
', print_r($data, true), ''; } } - if (!function_exists('getArrayValue')) { - /** - * Returns array value if key exists - * - * @param Array $array searchable array - * @param int $key array key - * @return string - * @access public - */ - // - function getArrayValue(&$array,$key) - { - $ret = isset($array[$key]) ? $array[$key] : false; - if ($ret && func_num_args() > 2) { - for ($i = 2; $i < func_num_args(); $i++) { - $cur_key = func_get_arg($i); - $ret = getArrayValue( $ret, $cur_key ); - if ($ret === false) break; - } + /** + * Returns array value if key exists + * + * @param Array $array searchable array + * @param int $key array key + * @return string + * @access public + */ + // + function getArrayValue(&$array, $key) + { + $ret = isset($array[$key]) ? $array[$key] : false; + if ($ret && func_num_args() > 2) { + for ($i = 2; $i < func_num_args(); $i++) { + $cur_key = func_get_arg($i); + $ret = getArrayValue( $ret, $cur_key ); + if ($ret === false) break; } - return $ret; } + return $ret; } /** @@ -101,19 +101,16 @@ $array = $new_array; } - if( !function_exists('safeDefine') ) + /** + * Define constant if it was not already defined before + * + * @param string $const_name + * @param string $const_value + * @access public + */ + function safeDefine($const_name, $const_value) { - /** - * Define constant if it was not already defined before - * - * @param string $const_name - * @param string $const_value - * @access public - */ - function safeDefine($const_name, $const_value) - { - if(!defined($const_name)) define($const_name,$const_value); - } + if(!defined($const_name)) define($const_name,$const_value); } if( !function_exists('parse_portal_ini') ) @@ -393,18 +390,15 @@ return $result; } - if( !function_exists('constOn') ) + /** + * Checks if constant is defined and has positive value + * + * @param string $const_name + * @return bool + */ + function constOn($const_name) { - /** - * Checks if constant is defined and has positive value - * - * @param string $const_name - * @return bool - */ - function constOn($const_name) - { - return defined($const_name) && constant($const_name); - } + return defined($const_name) && constant($const_name); } function Kg2Pounds($kg) Index: branches/unlabeled/unlabeled-1.96.2/globals.php =================================================================== diff -u -r3962 -r4178 --- branches/unlabeled/unlabeled-1.96.2/globals.php (.../globals.php) (revision 3962) +++ branches/unlabeled/unlabeled-1.96.2/globals.php (.../globals.php) (revision 4178) @@ -1351,14 +1351,6 @@ return $x; } -if (!function_exists('print_pre')) { - function print_pre($str) - { - // no comments here :) - echo '
'.print_r($str, true).''; - } -} - function GetOptions($field) // by Alex { // get dropdown values from custom field @@ -1552,20 +1544,6 @@ if($SFValue == 1 || $SFValue == 2) $list->Clear(); } -if( !function_exists('getArrayValue') ) -{ - /** - * Returns array value if key exists - * - * @param Array $aArray - * @param int $aIndex - * @return string - */ - function getArrayValue(&$aArray, $aIndex) - { - return isset($aArray[$aIndex]) ? $aArray[$aIndex] : false; - } -} function MakeHTMLTag($element, $attrib_prefix) { $result = Array(); @@ -1947,21 +1925,6 @@ header('Location: '.$adminURL.'/index.php?'.$redirect_params); exit; } - - if( !function_exists('safeDefine') ) - { - /** - * Define constant if it was not already defined before - * - * @param string $const_name - * @param string $const_value - * @access public - */ - function safeDefine($const_name, $const_value) - { - if(!defined($const_name)) define($const_name,$const_value); - } - } /** * Builds up K4 url from data supplied by in-portal @@ -2013,20 +1976,6 @@ return $ret; } - if( !function_exists('constOn') ) - { - /** - * Checks if constant is defined and has positive value - * - * @param string $const_name - * @return bool - */ - function constOn($const_name) - { - return defined($const_name) && constant($const_name); - } - } - function &recallObject($var_name, $class_name) { if (!isset($GLOBALS[$var_name]) || !is_object($GLOBALS[$var_name])) Index: branches/unlabeled/unlabeled-1.11.20/admin/reviews.php =================================================================== diff -u -r3283 -r4178 --- branches/unlabeled/unlabeled-1.11.20/admin/reviews.php (.../reviews.php) (revision 3283) +++ branches/unlabeled/unlabeled-1.11.20/admin/reviews.php (.../reviews.php) (revision 4178) @@ -13,8 +13,6 @@ ## privileges along maximum prosecution allowed by law. ## ############################################################## -//KERNEL4 STARTUP - FOR ACTIONS HANDLING - function k4getmicrotime() { list($usec, $sec) = explode(" ", microtime()); @@ -23,22 +21,17 @@ $start = k4getmicrotime(); -define('ADMIN', 1); -define('FULL_PATH', realpath(dirname(__FILE__).'/..')); -define('APPLICATION_CLASS', 'MyApplication'); -include_once(FULL_PATH."/kernel/kernel4/startup.php"); +// new startup: begin +define('REL_PATH', 'admin'); +$relation_level = count( explode('/', REL_PATH) ); +define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) ); +require_once FULL_PATH.'/kernel/startup.php'; +// new startup: end -$application =& kApplication::Instance(); -$application->Init(); -$application->ProcessRequest(); - -//KERNEL4 END - define('REQUIRE_LAYER_HEADER', 1); $b_topmargin = "0"; //$b_header_addon = "