Index: branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php
===================================================================
diff -u -r7828 -r7837
--- branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7828)
+++ branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7837)
@@ -320,6 +320,11 @@
function refreshModuleInfo()
{
+ if (defined('IS_INSTALL') && IS_INSTALL && !$this->TableFound('Modules')) {
+ $this->registerModuleConstants();
+ return false;
+ }
+
$modules_helper =& $this->recallObject('ModulesHelper');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'Modules
@@ -1723,6 +1728,10 @@
$res = isset($this->ConfigHash[$name]) ? $this->ConfigHash[$name] : false;
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) {
$this->ConfigHash[$name] = $res['VariableValue'];
@@ -2065,7 +2074,6 @@
if ( isset($this->Debugger) )
{
$errorLevel = constOn('DBG_SQL_FAILURE') && !defined('IS_INSTALL') ? E_USER_ERROR : E_USER_WARNING;
- $this->Debugger->dumpVars($_REQUEST);
$this->Debugger->appendTrace();
$error_msg = ''.$msg.' ('.$code.')
SQL: '.$this->Debugger->formatSQL($sql);
@@ -2438,6 +2446,27 @@
return $is_spider;
}
+
+ /**
+ * Allows to detect table's presense in database
+ *
+ * @param string $table_name
+ * @return bool
+ */
+ function TableFound($table_name)
+ {
+ static $table_found = Array();
+
+ if (!preg_match('/^'.preg_quote(TABLE_PREFIX, '/').'(.*)/', $table_name)) {
+ $table_name = TABLE_PREFIX.$table_name;
+ }
+
+ if (!isset($table_found[$table_name])) {
+ $table_found[$table_name] = $this->Conn->Query('SHOW TABLES LIKE "'.$table_name.'"');
+ }
+
+ return $table_found[$table_name];
+ }
}
?>
\ No newline at end of file