@@ -164,7 +164,7 @@ class MySQL_wrapper {
164164 * @param string $database - MySQL Database
165165 * @return - singleton instance
166166 */
167- public static function getInstance ($ server = NULL , $ username = NULL , $ password = NULL , $ database = NULL ){
167+ public static function getInstance ($ server = NULL , $ username = NULL , $ password = NULL , $ database = NULL ) {
168168 $ md5 = md5 (implode ('| ' , array ($ server , $ username , $ password , $ database )));
169169 if (empty (self ::$ instance [$ md5 ])) {
170170 self ::$ instance [$ md5 ] = new MySQL_wrapper ($ server , $ username , $ password , $ database );
@@ -327,7 +327,7 @@ public function query($sql) {
327327 $ sql = str_replace ($ p ['search ' ], $ p ['replace ' ], $ sql );
328328 unset($ l , $ p );
329329 }
330- if ($ this ->logQueries ) $ start = $ this ->getMicrotime ();
330+ if ($ this ->logQueries ) $ start = $ this ->getMicrotime ();
331331 $ this ->query = $ this ->call ('query ' , $ sql ) or $ this ->error ("Query fail: " . $ sql );
332332 $ this ->affected = $ this ->call ('affected_rows ' );
333333 if ($ this ->query && $ this ->logQueries ) $ this ->log ('QUERY ' , "EXEC -> " . number_format ($ this ->getMicrotime () - $ start , 8 ) . " -> " . $ sql );
@@ -569,7 +569,7 @@ public function importUpdateCSV2Table($file, $table, $delimiter = ',', $enclosur
569569 // Remove auto_increment if exists
570570 $ change = array ();
571571 $ this ->query ("SHOW COLUMNS FROM ` {$ tmp_name }` WHERE `Key` NOT LIKE ''; " );
572- if ($ this ->affected > 0 ){
572+ if ($ this ->affected > 0 ) {
573573 while ($ row = $ this ->fetchArray ()) {
574574 $ change [$ row ['Field ' ]] = "CHANGE ` {$ row ['Field ' ]}` ` {$ row ['Field ' ]}` {$ row ['Type ' ]}" ;
575575 }
@@ -923,7 +923,7 @@ public function query2XML($query, $rootElementName, $childElementName, $file = N
923923 // The child will take the name of the result column name
924924 $ record .= "\t\t< {$ fieldName }> " ;
925925 // Set empty columns with NULL and escape XML entities
926- if (!empty ($ row ->$ fieldName )) {
926+ if (!empty ($ row ->$ fieldName )) {
927927 $ record .= htmlspecialchars ($ row ->$ fieldName , ENT_XML1 );
928928 } else {
929929 $ record .= NULL ;
@@ -1079,7 +1079,7 @@ public function initTableRevision($table) {
10791079 // Remove auto_increment if exists
10801080 $ change = array ();
10811081 $ this ->query ("SHOW COLUMNS FROM ` {$ rev_table }` WHERE `Key` NOT LIKE '' OR `Default` IS NOT NULL; " );
1082- if ($ this ->affected > 0 ){
1082+ if ($ this ->affected > 0 ) {
10831083 while ($ row = $ this ->fetchArray ()) {
10841084 $ change [$ row ['Field ' ]] = "CHANGE ` {$ row ['Field ' ]}` ` {$ row ['Field ' ]}` {$ row ['Type ' ]} DEFAULT " . (($ row ['Extra ' ]) ? 0 : 'NULL ' );
10851085 }
@@ -1092,7 +1092,7 @@ public function initTableRevision($table) {
10921092 // Remove indexes from revision table
10931093 $ this ->query ("SHOW INDEXES FROM ` {$ rev_table }`; " );
10941094 $ drop = array ();
1095- if ($ this ->affected > 0 ){
1095+ if ($ this ->affected > 0 ) {
10961096 while ($ row = $ this ->fetchArray ()) {
10971097 $ drop [] = "DROP INDEX ` {$ row ['Key_name ' ]}` " ;
10981098 }
0 commit comments