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; }