From e38d145b1b5392e9a88101f7dd5a31173e4cfa90 Mon Sep 17 00:00:00 2001 From: jwarnier <jwarnier@ispconfig3> Date: Fri, 24 Sep 2010 21:26:50 -0400 Subject: [PATCH] - setup and use $conf['ispconfig_log_dir'], somehow replacing ISPC_LOG_PATH/$conf['logpath'] - replace double-quotes with single-quotes whenever appropriate - fix indentation --- server/lib/classes/db_mysql.inc.php | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index fb4f307..c2a5a35 100644 --- a/server/lib/classes/db_mysql.inc.php +++ b/server/lib/classes/db_mysql.inc.php @@ -36,7 +36,7 @@ var $linkId = 0; // last result of mysql_connect() var $queryId = 0; // last result of mysql_query() var $record = array(); // last record fetched - var $autoCommit = 1; // Autocommit Transactions + var $autoCommit = 1; // Autocommit Transactions var $currentRow; // current row number var $errorNumber = 0; // last error number var $errorMessage = ''; // last error message @@ -339,7 +339,8 @@ return true; } - + + public function closeConn() { if($this->linkId) @@ -397,17 +398,16 @@ if($col['autoInc'] == true) $sql .= 'auto_increment '; $sql.= ','; // key Definitionen - if($col['option'] == 'primary') $index .= "PRIMARY KEY (".$col['name']."),"; - if($col['option'] == 'index') $index .= "INDEX (".$col['name']."),"; - if($col['option'] == 'unique') $index .= "UNIQUE (".$col['name']."),"; + if($col['option'] == 'primary') $index .= 'PRIMARY KEY ('.$col['name'].'),'; + if($col['option'] == 'index') $index .= 'INDEX ('.$col['name'].'),'; + if($col['option'] == 'unique') $index .= 'UNIQUE ('.$col['name'].'),'; } $sql .= $index; $sql = substr($sql,0,-1); $sql .= ')'; - $this->query($sql); return true; - } + } /* $columns = array(action => add | alter | drop @@ -427,11 +427,11 @@ $sql = "ALTER TABLE $table_name "; foreach($columns as $col){ if($col['action'] == 'add') { - $sql .= "ADD ".$col['name'].' '.$this->mapType($col['type'],$col['typeValue']).' '; + $sql .= 'ADD '.$col['name'].' '.$this->mapType($col['type'],$col['typeValue']).' '; } elseif ($col['action'] == 'alter') { - $sql .= "CHANGE ".$col['name']." ".$col['name_new'].' '.$this->mapType($col['type'],$col['typeValue']).' '; + $sql .= 'CHANGE '.$col['name'].' '.$col['name_new'].' '.$this->mapType($col['type'],$col['typeValue']).' '; } elseif ($col['action'] == 'drop') { - $sql .= "DROP ".$col['name'].' '; + $sql .= 'DROP '.$col['name'].' '; } if($col['action'] != 'drop') { if($col['defaultValue'] != '') $sql .= "DEFAULT '".$col['defaultValue']."' "; @@ -442,10 +442,10 @@ } if($col['autoInc'] == true) $sql .= 'auto_increment '; $sql.= ','; - // key Definitionen - if($col['option'] == 'primary') $index .= "PRIMARY KEY (".$col['name']."),"; - if($col['option'] == 'index') $index .= "INDEX (".$col['name']."),"; - if($col['option'] == 'unique') $index .= "UNIQUE (".$col['name']."),"; + // Index definitions + if($col['option'] == 'primary') $index .= 'PRIMARY KEY ('.$col['name'].'),'; + if($col['option'] == 'index') $index .= 'INDEX ('.$col['name'].'),'; + if($col['option'] == 'unique') $index .= 'UNIQUE ('.$col['name'].'),'; } } $sql .= $index; @@ -493,7 +493,7 @@ global $go_api,$go_info; // Tabellenfelder einlesen - if($rows = $go_api->db->queryAllRecords("SHOW FIELDS FROM ".$table_name)){ + if($rows = $go_api->db->queryAllRecords('SHOW FIELDS FROM '.$table_name)){ foreach($rows as $row) { $name = $row[0]; $default = $row[4]; -- Gitblit v1.9.1