Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r10274 -r10459 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 10274) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 10459) @@ -77,13 +77,13 @@ function ItemCount($params) { - $cat_object =& $this->getObject($params); + $object =& $this->getObject($params); $ci_table = $this->Application->getUnitOption('l-ci', 'TableName'); $sql = 'SELECT COUNT(*) - FROM '.$cat_object->TableName.' c - LEFT JOIN '.$ci_table.' ci ON c.CategoryId=ci.CategoryId - WHERE c.ParentPath LIKE "'.$cat_object->GetDBField('ParentPath').'%" AND NOT (ci.CategoryId IS NULL)'; + FROM ' . $object->TableName . ' c + LEFT JOIN ' . $ci_table . ' ci ON c.CategoryId = ci.CategoryId + WHERE (c.TreeLeft BETWEEN ' . $object->GetDBField('TreeLeft') . ' AND ' . $object->GetDBField('TreeRight') . ') AND NOT (ci.CategoryId IS NULL)'; return $this->Conn->GetOne($sql); } Index: branches/RC/core/units/general/helpers/count_helper.php =================================================================== diff -u -N -r9002 -r10459 --- branches/RC/core/units/general/helpers/count_helper.php (.../count_helper.php) (revision 9002) +++ branches/RC/core/units/general/helpers/count_helper.php (.../count_helper.php) (revision 10459) @@ -223,11 +223,16 @@ */ function GetPermissionClause($prefix, $table_alias) { - $sql = 'SELECT PermissionConfigId - FROM '.TABLE_PREFIX.'PermissionConfig - WHERE PermissionName = "'.$this->Application->getUnitOption($prefix, 'PermItemPrefix').'.VIEW"'; - $view_perm = $this->Conn->GetOne($sql); + $view_perm = $this->Application->getCache(__CLASS__ . __FUNCTION__, $prefix); + if ($view_perm === false) { + $sql = 'SELECT PermissionConfigId + FROM '.TABLE_PREFIX.'PermissionConfig + WHERE PermissionName = "'.$this->Application->getUnitOption($prefix, 'PermItemPrefix').'.VIEW"'; + $view_perm = $this->Conn->GetOne($sql); + $this->Application->setCache(__CLASS__ . __FUNCTION__, $prefix, $view_perm); + } + $groups = explode(',', $this->Application->RecallVar('UserGroups')); foreach ($groups as $group) { $view_filters[] = 'FIND_IN_SET('.$group.', '.$table_alias.'.acl)'; Index: branches/RC/core/units/general/cat_tag_processor.php =================================================================== diff -u -N -r10455 -r10459 --- branches/RC/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 10455) +++ branches/RC/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 10459) @@ -402,7 +402,7 @@ $object =& $this->getObject($params); /* @var $object kDBItem */ - if ($this->Application->ConfigValue('UseFloatRating')) { + if (false && $this->Application->ConfigValue('UseFloatRating')) { $rating = $object->GetDBField('CachedRating'); $float_rating = floor(($rating - floor($rating)) / 0.25) * 0.25; } Index: branches/RC/core/units/general/helpers/mod_rewrite_helper.php =================================================================== diff -u -N -r10426 -r10459 --- branches/RC/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 10426) +++ branches/RC/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 10459) @@ -245,6 +245,13 @@ function GetItemTemplate($category, $module_prefix) { + $cache_key = serialize($category) . '_' . $module_prefix; + + $cached_value = $this->Application->getCache(__CLASS__ . __FUNCTION__, $cache_key); + if ($cached_value !== false) { + return $cached_value; + } + if (!is_array($category)) { if ($category == 0) { $category = $this->Application->findModule('Var', $module_prefix, 'RootCat'); @@ -257,10 +264,7 @@ $parent_path = implode(',',explode('|', substr($category['ParentPath'], 1, -1))); // item template is stored in module' system custom field - need to get that field Id - $item_template_field_id = $this->Conn->GetOne( - 'SELECT CustomFieldId - FROM '.TABLE_PREFIX.'CustomField - WHERE FieldName = '.$this->Conn->qstr($module_prefix.'_ItemTemplate')); + $item_template_field_id = $this->_getItemTemplateCustomField($module_prefix); // looking for item template through cats hierarchy sorted by parent path $query = 'SELECT ccd.l1_cust_'.$item_template_field_id.', @@ -272,9 +276,29 @@ WHERE c.CategoryId IN ('.$parent_path.') AND ccd.l1_cust_'.$item_template_field_id.' != \'\' ORDER BY FIND_IN_SET(c.CategoryId, '.$this->Conn->qstr($parent_path).') DESC'; $item_template = $this->Conn->GetOne($query); + + $this->Application->setCache(__CLASS__ . __FUNCTION__, $cache_key, $item_template); + return $item_template; } + function _getItemTemplateCustomField($module_prefix) + { + $cached_value = $this->Application->getCache(__CLASS__ . __FUNCTION__, $module_prefix); + if ($cached_value !== false) { + return $cached_value; + } + + $sql = 'SELECT CustomFieldId + FROM '.TABLE_PREFIX.'CustomField + WHERE FieldName = '.$this->Conn->qstr($module_prefix.'_ItemTemplate'); + $item_template_field_id = $this->Conn->GetOne($sql); + + $this->Application->setCache(__CLASS__ . __FUNCTION__, $module_prefix, $item_template_field_id); + + return $item_template_field_id; + } + function ProcessPhisycalTemplate(&$url_parts, &$vars) { if (!isset($url_parts[0])) return false; Index: branches/RC/core/units/general/country_states.php =================================================================== diff -u -N -r10098 -r10459 --- branches/RC/core/units/general/country_states.php (.../country_states.php) (revision 10098) +++ branches/RC/core/units/general/country_states.php (.../country_states.php) (revision 10459) @@ -18,26 +18,34 @@ */ function PopulateStates(&$event, $state_field, $country_field) { + static $country_states = Array (); + $object =& $event->getObject(); $country_abbr = $object->GetDBField($country_field); - if (!$country_abbr) return; - $country_id = $this->Conn->GetOne('SELECT DestId FROM '.TABLE_PREFIX.'StdDestinations WHERE DestType=1 AND DestAbbr = '.$this->Conn->qstr($country_abbr)); - if (!$country_id) return; + if (!$country_abbr) { + return ; + } - $query = - 'SELECT p.Translation as DestName, sd.DestAbbr - FROM '.TABLE_PREFIX.'StdDestinations AS sd - LEFT JOIN '.TABLE_PREFIX.'Phrase AS p - ON p.Phrase = sd.DestName - WHERE - DestType=2 AND DestParentId='.$country_id.' - AND - LanguageId = '.$this->Application->GetVar('m_lang').' - ORDER BY Translation'; + if (!array_key_exists($country_abbr, $country_states)) { + $sql = 'SELECT DestId + FROM '.TABLE_PREFIX.'StdDestinations + WHERE DestType = 1 AND DestAbbr = '.$this->Conn->qstr($country_abbr); + $country_id = $this->Conn->GetOne($sql); + if (!$country_id) { + return ; + } - $states = $this->Conn->GetCol($query, 'DestAbbr'); - $object->Fields[$state_field]['options'] = $states; + $sql = 'SELECT p.Translation as DestName, sd.DestAbbr + FROM ' . TABLE_PREFIX . 'StdDestinations AS sd + LEFT JOIN ' . TABLE_PREFIX . 'Phrase AS p ON p.Phrase = sd.DestName + WHERE DestType = 2 AND DestParentId = ' . $country_id . ' AND LanguageId = ' . $this->Application->GetVar('m_lang') . ' + ORDER BY Translation'; + + $country_states[$country_abbr] = $this->Conn->GetCol($sql, 'DestAbbr'); + } + + $object->Fields[$state_field]['options'] = $country_states[$country_abbr]; $object->Fields[$state_field]['options'][''] = ''; } Index: branches/RC/core/kernel/db/db_connection.php =================================================================== diff -u -N -r9205 -r10459 --- branches/RC/core/kernel/db/db_connection.php (.../db_connection.php) (revision 9205) +++ branches/RC/core/kernel/db/db_connection.php (.../db_connection.php) (revision 10459) @@ -79,6 +79,15 @@ var $lastQuery = ''; /** + * Total processed queries count + * + * @var int + */ + var $_queryCount = 0; + +// var $_queryLog = Array (); + + /** * Initializes connection class with * db type to used in future * @@ -336,10 +345,21 @@ * @param string $key_field * @return Array */ - function Query($sql, $key_field = null) + function Query($sql, $key_field = null, $no_debug = false) { $this->lastQuery = $sql; - if ($this->debugMode) return $this->debugQuery($sql,$key_field); + $this->_queryCount++; + + /*if (!array_key_exists($sql, $this->_queryLog)) { + $this->_queryLog[$sql] = 1; + } + else { + $this->_queryLog[$sql]++; + }*/ + + if ($this->debugMode && !$no_debug) { + return $this->debugQuery($sql,$key_field); + } $query_func = $this->getMetaFunction('query'); $this->queryID = $query_func($sql,$this->connectionID); if (is_resource($this->queryID)) { @@ -404,7 +424,7 @@ // set 2nd checkpoint: begin $first_cell = count($ret) == 1 && count(current($ret)) == 1 ? current(current($ret)) : null; if ($profileSQLs) { - $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows(), $first_cell); + $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows(), $first_cell, $this->_queryCount); $debugger->profilerAddTotal('sql', 'sql_'.$queryID); } $this->Destroy(); @@ -414,7 +434,7 @@ else { // set 2nd checkpoint: begin if ($profileSQLs) { - $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows()); + $debugger->profileFinish('sql_'.$queryID, null, null, $this->getAffectedRows(), null, $this->_queryCount); $debugger->profilerAddTotal('sql', 'sql_'.$queryID); } // set 2nd checkpoint: end Index: branches/RC/core/kernel/utility/debugger/debugger.css =================================================================== diff -u -N -r8929 -r10459 --- branches/RC/core/kernel/utility/debugger/debugger.css (.../debugger.css) (revision 8929) +++ branches/RC/core/kernel/utility/debugger/debugger.css (.../debugger.css) (revision 10459) @@ -7,12 +7,22 @@ display: inline; } -.dbg_flat_table, .dbg_stats_table { +.dbg_flat_table, .dbg_stats_table, table.dbg_explain_table { border-collapse: collapse; width: auto; margin: 0px; } +table.dbg_explain_table TD { + border: 1px solid #000000; + padding: 4px; +} + +table.dbg_explain_table tr.explain_header TD { + font-weight: bold; + text-align: center; +} + .dbg_flat_table TD, .dbg_stats_table TD { border: 1px solid #CCCCCC; padding: 4px; Index: branches/RC/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r10396 -r10459 --- branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 10396) +++ branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 10459) @@ -775,16 +775,18 @@ } // linking existing images for item with virtual fields - $image_helper =& $this->Application->recallObject('ImageHelper'); - /* @var $image_helper ImageHelper */ + if ($event->Prefix != 'cms') { + $image_helper =& $this->Application->recallObject('ImageHelper'); + /* @var $image_helper ImageHelper */ - $image_helper->LoadItemImages($object); + $image_helper->LoadItemImages($object); - // linking existing files for item with virtual fields - $file_helper =& $this->Application->recallObject('FileHelper'); - /* @var $file_helper FileHelper */ + // linking existing files for item with virtual fields + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ - $file_helper->LoadItemFiles($object); + $file_helper->LoadItemFiles($object); + } // set item's additional categories to virtual field (used in editing) $item_categories = $this->getItemCategories($object->GetDBField('ResourceId')); @@ -800,21 +802,23 @@ } if (!$this->Application->IsAdmin()) { - $image_helper =& $this->Application->recallObject('ImageHelper'); - /* @var $image_helper ImageHelper */ - $object =& $event->getObject(); /* @var $object kDBItem */ - // process image upload in virtual fields - $image_helper->SaveItemImages($object); + if ($event->Prefix != 'cms') { + $image_helper =& $this->Application->recallObject('ImageHelper'); + /* @var $image_helper ImageHelper */ - $file_helper =& $this->Application->recallObject('FileHelper'); - /* @var $file_helper FileHelper */ + // process image upload in virtual fields + $image_helper->SaveItemImages($object); - // process file upload in virtual fields - $file_helper->SaveItemFiles($object); + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ + // process file upload in virtual fields + $file_helper->SaveItemFiles($object); + } + if ($event->Special != '-item') { // don't touch categories during cloning $this->processAdditionalCategories($object, 'update'); @@ -834,21 +838,23 @@ } if (!$this->Application->IsAdmin()) { - $image_helper =& $this->Application->recallObject('ImageHelper'); - /* @var $image_helper ImageHelper */ - $object =& $event->getObject(); /* @var $object kDBItem */ - // process image upload in virtual fields - $image_helper->SaveItemImages($object); + if ($event->Prefix != 'cms') { + $image_helper =& $this->Application->recallObject('ImageHelper'); + /* @var $image_helper ImageHelper */ - $file_helper =& $this->Application->recallObject('FileHelper'); - /* @var $file_helper FileHelper */ + // process image upload in virtual fields + $image_helper->SaveItemImages($object); - // process file upload in virtual fields - $file_helper->SaveItemFiles($object); + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ + // process file upload in virtual fields + $file_helper->SaveItemFiles($object); + } + if ($event->Special != '-item') { // don't touch categories during cloning $this->processAdditionalCategories($object, 'create'); @@ -2344,11 +2350,15 @@ */ function OnAfterConfigRead(&$event) { - $file_helper =& $this->Application->recallObject('FileHelper'); - /* @var $file_helper FileHelper */ + parent::OnAfterConfigRead($event); - $file_helper->createItemFiles($event->Prefix, true); // create image fields - $file_helper->createItemFiles($event->Prefix, false); // create file fields + if ($event->Prefix != 'cms') { + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ + + $file_helper->createItemFiles($event->Prefix, true); // create image fields + $file_helper->createItemFiles($event->Prefix, false); // create file fields + } } /** Index: branches/RC/core/kernel/utility/debugger.php =================================================================== diff -u -N -r10304 -r10459 --- branches/RC/core/kernel/utility/debugger.php (.../debugger.php) (revision 10304) +++ branches/RC/core/kernel/utility/debugger.php (.../debugger.php) (revision 10459) @@ -4,6 +4,14 @@ class Debugger { /** + * Holds reference to global KernelApplication instance + * + * @access public + * @var kApplication + */ + var $Application = null; + + /** * Set to true if fatal error occured * * @var bool @@ -173,6 +181,11 @@ $dbg_constMap['DBG_SQL_PROFILE'] = 0; } + // when showing explain make shure, that debugger window is large enough + if (array_key_exists('DBG_SQL_EXPLAIN', $dbg_constMap) && $dbg_constMap['DBG_SQL_EXPLAIN']) { + $dbg_constMap['DBG_WINDOW_WIDTH'] = 1000; + } + foreach ($dbg_constMap as $dbg_constName => $dbg_constValue) { $this->safeDefine($dbg_constName, $dbg_constValue); } @@ -565,14 +578,35 @@ */ function formatSQL($sql) { - $sql = preg_replace('/(\n|\t| )+/is', ' ', $sql); - $sql = preg_replace('/(CREATE TABLE|DROP TABLE|SELECT|UPDATE|SET|REPLACE|INSERT|DELETE|VALUES|FROM|LEFT JOIN|INNER JOIN|LIMIT|WHERE|HAVING|GROUP BY|ORDER BY) /is', "\n\t$1 ", $sql); - return $this->highlightString($sql); + $sql = trim( preg_replace('/(\n|\t| )+/is', ' ', $sql) ); + + $formatted_sql = preg_replace('/\s(CREATE TABLE|DROP TABLE|SELECT|UPDATE|SET|REPLACE|INSERT|DELETE|VALUES|FROM|LEFT JOIN|INNER JOIN|LIMIT|WHERE|HAVING|GROUP BY|ORDER BY)\s/is', "\n\t$1 ", ' ' . $sql); + $formatted_sql = $this->highlightString($formatted_sql); + + if (defined('DBG_SQL_EXPLAIN') && DBG_SQL_EXPLAIN) { + if (substr($sql, 0, 6) == 'SELECT') { + $formatted_sql .= '
' . 'Explain:

'; + $explain_result = $this->Application->Conn->Query('EXPLAIN ' . $sql, null, true); + + $explain_table = ''; + foreach ($explain_result as $explain_row) { + if (!$explain_table) { + // first row -> draw header + $explain_table .= '' . implode('', array_keys($explain_row)) . ''; + } + $explain_table .= '' . implode('', $explain_row) . ''; + } + + $formatted_sql .= '' . $explain_table . '
'; + } + } + + return $formatted_sql; } function highlightString($string) { - if (!$this->constOn('DBG_USE_HIGHLIGHT')) { + if (!(defined('DBG_USE_HIGHLIGHT') && DBG_USE_HIGHLIGHT)) { return $string; } @@ -806,16 +840,18 @@ $func_arguments = func_get_args(); $rows_affected = $func_arguments[3]; + $additional = Array (); + if ($rows_affected > 0) { - $additional = Array ( - Array ('name' => 'Affected Rows', 'value' => $rows_affected), - ); + $additional[] = Array ('name' => 'Affected Rows', 'value' => $rows_affected); if (isset($func_arguments[4])) { $additional[] = Array ('name' => 'Result', 'value' => $func_arguments[4]); } - $this->ProfilerData[$key]['additional'] =& $additional; } + + $additional[] = Array ('name' => 'Query Number', 'value' => $func_arguments[5]); + $this->ProfilerData[$key]['additional'] =& $additional; } } @@ -1281,13 +1317,15 @@ } function AttachToApplication() { - if (!$this->constOn('DBG_HANDLE_ERRORS')) return true; + if (!$this->constOn('DBG_HANDLE_ERRORS')) { + return true; + } if (class_exists('kApplication')) { restore_error_handler(); - $application =& kApplication::Instance(); - $application->Debugger =& $this; - $application->errorHandlers[] = Array(&$this, 'saveError'); + $this->Application =& kApplication::Instance(); + $this->Application->Debugger =& $this; + $this->Application->errorHandlers[] = Array(&$this, 'saveError'); } else { set_error_handler(Array(&$this, 'saveError')); Index: branches/RC/core/units/custom_data/custom_data_event_handler.php =================================================================== diff -u -N -r9234 -r10459 --- branches/RC/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 9234) +++ branches/RC/core/units/custom_data/custom_data_event_handler.php (.../custom_data_event_handler.php) (revision 10459) @@ -24,6 +24,8 @@ function scanCustomFields($prefix) { + static $custom_fields = Array (); + if (defined('IS_INSTALL') && IS_INSTALL && !$this->Application->TableFound('CustomField')) { return false; } @@ -39,18 +41,24 @@ return false; } - // get custom field information - $sql = 'SELECT * - FROM '.TABLE_PREFIX.'CustomField - WHERE Type = '.$item_type.' - ORDER BY CustomFieldId'; - $custom_fields = $this->Conn->Query($sql, 'CustomFieldId'); if (!$custom_fields) { - // config doesn't have custom fields - return false; + // query all custom fields at once -> saves 4 sqls queries + $sql = 'SELECT * + FROM '.TABLE_PREFIX.'CustomField'; + $all_custom_fields = $this->Conn->Query($sql, 'CustomFieldId'); + ksort($all_custom_fields); + + foreach ($all_custom_fields as $custom_field_id => $custom_field_data) { + $cf_type = $custom_field_data['Type']; + if (!array_key_exists($cf_type, $custom_fields)) { + $custom_fields[$cf_type] = Array (); + } + + $custom_fields[$cf_type][$custom_field_id] = $custom_field_data; + } } - return $custom_fields; + return array_key_exists($item_type, $custom_fields) ? $custom_fields[$item_type] : false; } /** Index: branches/RC/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r10336 -r10459 --- branches/RC/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 10336) +++ branches/RC/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 10459) @@ -36,18 +36,19 @@ $event_manager =& $this->Application->recallObject('EventManager'); $aggregator =& $this->Application->recallObject('TagsAggregator', 'kArray'); - $config_vars = Array( - 'SessionTimeout', - 'SessionCookieName', - 'SessionReferrerCheck', - 'CookieSessions', - 'UseCronForRegularEvent', - 'User_GuestGroup', - 'User_LoggedInGroup', - 'SessionTimeout', - 'UseModRewrite', - 'UseOutputCompression', - 'OutputCompressionLevel', + $config_vars = Array ( + 'SessionTimeout', + 'SessionCookieName', + 'SessionReferrerCheck', + 'CookieSessions', + 'UseCronForRegularEvent', + 'User_GuestGroup', + 'User_LoggedInGroup', + 'SessionTimeout', + 'UseModRewrite', + 'UseOutputCompression', + 'OutputCompressionLevel', + 'KeepSessionOnBrowserClose', ); foreach ($config_vars as $var) { Index: branches/RC/core/kernel/application.php =================================================================== diff -u -N -r10334 -r10459 --- branches/RC/core/kernel/application.php (.../application.php) (revision 10334) +++ branches/RC/core/kernel/application.php (.../application.php) (revision 10459) @@ -440,10 +440,13 @@ { static $language_id = 0; - if ($language_id > 0) return $language_id; + if ($language_id > 0) { + return $language_id; + } - $table = $this->getUnitOption('lang','TableName'); - $id_field = $this->getUnitOption('lang','IDField'); + $table = $this->getUnitOption('lang', 'TableName'); + $id_field = $this->getUnitOption('lang', 'IDField'); + $sql = 'SELECT '.$id_field.' FROM '.$table.' WHERE (PrimaryLang = 1) AND (Enabled = 1)'; @@ -796,6 +799,20 @@ $this->Debugger->appendMemoryUsage('Application before Done:'); } + + /*$dupe_queries = Array (); + foreach ($this->Conn->_queryLog as $sql => $repeat_count) { + if ($repeat_count > 1) { + $dupe_queries[] = Array ( + 'sql' => $this->Debugger->formatSQL($sql), + 'dupe_count' => $repeat_count - 1, + ); + } + } + + print_pre($dupe_queries, 'Duplicate SQLs', true);*/ + + if ($this->GetVar('admin')) { $reg = '/('.preg_quote(BASE_PATH, '/').'.*\.html)(#.*){0,1}(")/sU'; $this->HTML = preg_replace($reg, "$1?admin=1$2$3", $this->HTML); @@ -1775,17 +1792,25 @@ function ConfigValue($name) { $res = isset($this->ConfigHash[$name]) ? $this->ConfigHash[$name] : false; - if ($res !== false) return $res; + if ($res !== false) { + return $res; + } if (defined('IS_INSTALL') && IS_INSTALL && !$this->TableFound('ConfigurationValues')) { return false; } - $res = $this->Conn->GetRow('SELECT VariableId, VariableValue FROM '.TABLE_PREFIX.'ConfigurationValues WHERE VariableName = '.$this->Conn->qstr($name)); - if ($res) { + + $sql = 'SELECT VariableId, VariableValue + FROM '.TABLE_PREFIX.'ConfigurationValues + WHERE VariableName = '.$this->Conn->qstr($name); + $res = $this->Conn->GetRow($sql); + + if ($res !== false) { $this->ConfigHash[$name] = $res['VariableValue']; $this->ConfigCacheIds[] = $res['VariableId']; return $res['VariableValue']; } + return false; }