diff -u DBorig/common.php DB/common.php --- DBorig/common.php 2003-08-28 00:21:32.000000000 -0400 +++ DB/common.php 2003-08-28 02:06:38.000000000 -0400 @@ -683,14 +683,14 @@ * @see prepare() */ function freePrepared($stmt) - { - // Free the internal prepared vars + { + // Free the internal prepared vars if (isset($this->prepare_tokens[$stmt])) { unset($this->prepare_tokens[$stmt]); unset($this->prepare_types[$stmt]); - unset($this->prepared_queries[$stmt]); - return true; - } + unset($this->prepared_queries[$stmt]); + return true; + } return false; } diff -u DBorig/ibase.php DB/ibase.php --- DBorig/ibase.php 2003-08-28 00:21:32.000000000 -0400 +++ DB/ibase.php 2003-08-28 02:06:38.000000000 -0400 @@ -20,9 +20,9 @@ // // Database independent query interface definition for PHP's Interbase // extension. -// -// Bugs: -// - If dbsyntax is not firebird, the limitQuery may fail +// +// Bugs: +// - If dbsyntax is not firebird, the limitQuery may fail // - The palceholders '&' and '!' don't work here require_once 'DB/common.php'; @@ -50,7 +50,7 @@ 'pconnect' => true, 'transactions' => true, 'limit' => false - ); + ); // just a few of the tons of Interbase error codes listed in the // Language Reference section of the Interbase manual $this->errorcode_map = array( @@ -122,9 +122,9 @@ if (!$conn) { return $this->ibaseRaiseError(DB_ERROR_CONNECT_FAILED); } - $this->connection = $conn; - if ($this->dsn['dbsyntax'] == 'firebird') { - $this->features['limit'] = 'alter'; + $this->connection = $conn; + if ($this->dsn['dbsyntax'] == 'firebird') { + $this->features['limit'] = 'alter'; } return DB_OK; } @@ -146,7 +146,7 @@ { $ismanip = DB::isManip($query); $this->last_query = $query; - $query = $this->modifyQuery($query); + $query = $this->modifyQuery($query); $result = @ibase_query($this->connection, $query); if (!$result) { return $this->ibaseRaiseError(); @@ -179,7 +179,7 @@ function modifyLimitQuery($query, $from, $count) { if ($this->dsn['dbsyntax'] == 'firebird') { - //$from++; // SKIP starts from 1, ie SKIP 1 starts from the first record + //$from++; // SKIP starts from 1, ie SKIP 1 starts from the first record // (cox) Seems that SKIP starts in 0 $query = preg_replace('/^\s*select\s(.*)$/is', "SELECT FIRST $count SKIP $from $1", $query); @@ -210,26 +210,26 @@ // {{{ fetchInto() function fetchInto($result, &$ar, $fetchmode, $rownum = null) - { + { if ($rownum !== NULL) { return $this->ibaseRaiseError(DB_ERROR_NOT_CAPABLE); } - if ($fetchmode & DB_FETCHMODE_ASSOC) { - if (function_exists('ibase_fetch_assoc')) { - $ar = @ibase_fetch_assoc($result); + if ($fetchmode & DB_FETCHMODE_ASSOC) { + if (function_exists('ibase_fetch_assoc')) { + $ar = @ibase_fetch_assoc($result); } else { - $ar = get_object_vars(ibase_fetch_object($result)); + $ar = get_object_vars(ibase_fetch_object($result)); } if ($ar && $this->options['optimize'] == 'portability') { $ar = array_change_key_case($ar, CASE_LOWER); - } + } } else { $ar = @ibase_fetch_row($result); - } + } if (!$ar) { if ($errmsg = ibase_errmsg()) { return $this->ibaseRaiseError(null, $errmsg); - } else { + } else { return null; } } @@ -299,9 +299,9 @@ break; } } - $newquery = strtr($query, '&', '?'); + $newquery = strtr($query, '&', '?'); $this->last_query = $query; - $newquery = $this->modifyQuery($newquery); + $newquery = $this->modifyQuery($newquery); $stmt = ibase_prepare($this->connection, $newquery); $this->prepare_types[(int)$stmt] = $types; $this->manip_query[(int)$stmt] = DB::isManip($query); @@ -326,9 +326,9 @@ $types=&$this->prepare_types[$stmt]; if (($size = sizeof($types)) != sizeof($data)) { return $this->raiseError(DB_ERROR_MISMATCH); - } + } $pdata[0] = $stmt; - for ($j = 0; $j < $size; $j++) { + for ($j = 0; $j < $size; $j++) { $i = $j + 1; if (is_array($data)) { $pdata[$i] = &$data[$j]; @@ -341,25 +341,25 @@ if ($fp) { while (($buf = fread($fp, 4096)) != false) { $pdata[$i] .= $buf; - } + } fclose($fp); } - } - } + } + } $res = call_user_func_array('ibase_execute', $pdata); if (!$res) { return $this->ibaseRaiseError(); - } - /* XXX need this? - if ($this->autocommit && $this->manip_query[(int)$stmt]) { - ibase_commit($this->connection); - }*/ + } + /* XXX need this? + if ($this->autocommit && $this->manip_query[(int)$stmt]) { + ibase_commit($this->connection); + }*/ if ($this->manip_query[(int)$stmt]) { return DB_OK; } else { return new DB_result($this, $res); - } - } + } + } /** * Free the internal resources associated with a prepared query. @@ -369,18 +369,18 @@ * @return bool TRUE on success, FALSE if $result is invalid */ function freePrepared($stmt) - { - if (!is_resource($stmt)) { - return false; - } - ibase_free_query($stmt); + { + if (!is_resource($stmt)) { + return false; + } + ibase_free_query($stmt); unset($this->prepare_tokens[(int)$stmt]); unset($this->prepare_types[(int)$stmt]); unset($this->manip_query[(int)$stmt]); - return true; - } - - + return true; + } + + // }}} // {{{ autoCommit() @@ -434,7 +434,7 @@ do { $this->pushErrorHandling(PEAR_ERROR_RETURN); $result = $this->query("SELECT GEN_ID(${sqn}_SEQ, 1) FROM RDB\$GENERATORS" - ." WHERE RDB\$GENERATOR_NAME='${sqn}_SEQ'"); + ." WHERE RDB\$GENERATOR_NAME='${sqn}_SEQ'"); $this->popErrorHandling(); if ($ondemand && DB::isError($result)) { $repeat = 1; @@ -705,7 +705,7 @@ if ($db_errno === null) { if ($native_errno) { // try to interpret Interbase error code (that's why we need ibase_errno() - // in the interbase module to return the real error code) + // in the interbase module to return the real error code) switch ($native_errno) { case -204: if (is_int(strpos($m[3], 'Table unknown'))) { diff -u DBorig/mssql.php DB/mssql.php --- DBorig/mssql.php 2003-08-28 00:21:32.000000000 -0400 +++ DB/mssql.php 2003-08-28 02:06:38.000000000 -0400 @@ -57,7 +57,7 @@ 208 => DB_ERROR_NOSUCHTABLE, 245 => DB_ERROR_INVALID_NUMBER, 547 => DB_ERROR_CONSTRAINT, - 2714 => DB_ERROR_ALREADY_EXISTS, + 2714 => DB_ERROR_ALREADY_EXISTS, 3701 => DB_ERROR_NOSUCHTABLE ); } @@ -77,7 +77,7 @@ $pw = $dsninfo['password']; $dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost'; $port = $dsninfo['port'] ? ':' . $dsninfo['port'] : ''; - $dbhost .= $port; + $dbhost .= $port; $connect_function = $persistent ? 'mssql_pconnect' : 'mssql_connect'; @@ -341,17 +341,17 @@ $this->popErrorHandling(); if ($ondemand && DB::isError($result) && ($result->getCode() == DB_ERROR || $result->getCode() == DB_ERROR_NOSUCHTABLE)) - { + { $repeat = 1; $result = $this->createSequence($seq_name); if (DB::isError($result)) { return $this->raiseError($result); } - } elseif (!DB::isError($result)) { + } elseif (!DB::isError($result)) { $result = $this->query("SELECT @@IDENTITY FROM $seqname"); $repeat = 0; - } else { - $repeat = false; + } else { + $repeat = false; } } while ($repeat); if (DB::isError($result)) { @@ -396,14 +396,14 @@ // {{{ mssqlRaiseError() function mssqlRaiseError($code = null) - { + { $native_msg = mssql_get_last_message(); $native_code = $this->errorCode(); - if ($code === null) { - if (isset($this->errorcode_map[$native_code])) { - $code = $this->errorcode_map[$native_code]; - } else { - $code = DB_ERROR; + if ($code === null) { + if (isset($this->errorcode_map[$native_code])) { + $code = $this->errorcode_map[$native_code]; + } else { + $code = DB_ERROR; } } return $this->raiseError($code, null, null, null, $native_code . ' - ' . $native_msg); diff -u DBorig/mysql.php DB/mysql.php --- DBorig/mysql.php 2003-08-28 00:21:32.000000000 -0400 +++ DB/mysql.php 2003-08-28 02:06:39.000000000 -0400 @@ -563,11 +563,11 @@ return $res; } // insert yields value 1, nextId call will generate ID 2 - $res = $this->query("INSERT INTO ${seqname} VALUES(0)"); - if (DB::isError($res)) { - return $res; - } - // so reset to zero + $res = $this->query("INSERT INTO ${seqname} VALUES(0)"); + if (DB::isError($res)) { + return $res; + } + // so reset to zero return $this->query("UPDATE ${seqname} SET id = 0;"); } diff -u DBorig/oci8.php DB/oci8.php --- DBorig/oci8.php 2003-08-28 00:21:32.000000000 -0400 +++ DB/oci8.php 2003-08-28 02:06:39.000000000 -0400 @@ -233,7 +233,7 @@ unset($this->manip_query[(int)$result]); return true; } - + /** * Free the internal resources associated with a prepared query. * @@ -243,15 +243,15 @@ */ function freePrepared($stmt) { - if (!is_resource($stmt)) { - return false; - } - ocifreestatement($stmt); + if (!is_resource($stmt)) { + return false; + } + ocifreestatement($stmt); unset($this->prepare_tokens[(int)$stmt]); unset($this->prepare_types[(int)$stmt]); unset($this->manip_query[(int)$stmt]); - return true; - } + return true; + } // }}} // {{{ numRows() @@ -392,7 +392,7 @@ if ($fp) { while (($buf = fread($fp, 4096)) != false) { $pdata[$i] .= $buf; - } + } fclose($fp); } }