cvs: pear /MDB/MDB oci8.php

From: Date: Fri, 17 Jan 2003 13:23:40 +0000
Subject: cvs: pear /MDB/MDB oci8.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8334@lists.php.net to get a copy of this message
lsmith Fri Jan 17 08:23:40 2003 EDT Modified files: /pear/MDB/MDB oci8.php Log: eleminated a bunch of parse errors

Index: pear/MDB/MDB/oci8.php diff -u pear/MDB/MDB/oci8.php:1.3 pear/MDB/MDB/oci8.php:1.4 --- pear/MDB/MDB/oci8.php:1.3 Thu Jan 16 12:50:44 2003 +++ pear/MDB/MDB/oci8.php Fri Jan 17 08:23:40 2003 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.3 2003/01/16 17:50:44 lsmith Exp $ +// $Id: oci8.php,v 1.4 2003/01/17 13:23:40 lsmith Exp $ if (!defined('MDB_OCI8_INCLUDED')) { define('MDB_OCI8_INCLUDED', 1); @@ -195,7 +195,7 @@ return(MDB_OK); } if ($this->connection && $auto_commit && !$this->CommitTransaction()) { - return($this->raiseError()) + return($this->raiseError()); } $this->auto_commit = $auto_commit; return($this->_registerTransactionShutdown($auto_commit)); @@ -275,7 +275,7 @@ { if (isset($this->options["SID"])) { $sid = $this->options["SID"]; - else { + } else { $sid = getenv("ORACLE_SID"); } if (!strcmp($sid, "")) { @@ -303,7 +303,7 @@ } if (!$this->_doQuery("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'")) { $this->_close(); - return($this->raiseError()) + return($this->raiseError()); } $this->connected_user = $user; $this->connected_password = $password; @@ -347,7 +347,10 @@ if ($prepared_query) { $columns = ""; $variables = ""; - for(reset($this->clobs[$prepared_query]), $clob = 0;$clob < count($this->clobs[$prepared_query]);$clob++, next($this->clobs[$prepared_query])) { + for(reset($this->clobs[$prepared_query]), $clob = 0; + $clob < count($this->clobs[$prepared_query]); + $clob++, next($this->clobs[$prepared_query])) + { $position = key($this->clobs[$prepared_query]); if (gettype($descriptors[$position] = OCINewDescriptor($this->connection, OCI_D_LOB)) != "object") { $success = $this->raiseError(MDB_ERROR, '', '', @@ -385,7 +388,10 @@ } } if (!MDB::isError($success)) { - for(reset($this->blobs[$prepared_query]), $blob = 0;$blob < count($this->blobs[$prepared_query]);$blob++, next($this->blobs[$prepared_query])) { + for(reset($this->blobs[$prepared_query]), $blob = 0; + $blob < count($this->blobs[$prepared_query]); + $blob++, next($this->blobs[$prepared_query])) + { $position = key($this->blobs[$prepared_query]); if (!OCIBindByName($statement, ":blob".$position, $descriptors[$position], -1, OCI_B_BLOB)) { $success = $this->oci8RaiseError(MDB_ERROR, '', '', @@ -398,7 +404,10 @@ if (!MDB::isError($success)) { if (($result = @OCIExecute($statement, ($lobs == 0 && $this->auto_commit) ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT))) { if ($lobs) { - for(reset($this->clobs[$prepared_query]), $clob = 0;$clob < count($this->clobs[$prepared_query]);$clob++, next($this->clobs[$prepared_query])) { + for(reset($this->clobs[$prepared_query]), $clob = 0; + $clob < count($this->clobs[$prepared_query]); + $clob++, next($this->clobs[$prepared_query])) + { $position = key($this->clobs[$prepared_query]); $clob_stream = $this->prepared_queries[$prepared_query-1]["Values"][$position-1]; for($value = "";!$this_>endOfLOB($clob_stream);) { @@ -445,7 +454,7 @@ } } } - } else + } else { $this->uncommitedqueries++; } if (!MDB::isError($success)) { @@ -453,8 +462,9 @@ case "SELECT": $result_value = intval($statement); $this->current_row[$result_value] = -1; - if ($limit > 0) + if ($limit > 0) { $this->limits[$result_value] = array($first, $limit, 0); + } $this->highest_fetched_row[$result_value] = -1; break; default: @@ -465,16 +475,17 @@ $result = $statement; } } else { - return $this->oci8RaiseError(NULL, - 'Do query: Could not execute query', OCIError($statement)); + return $this->oci8RaiseError(NULL, 'Do query: Could not execute query'); } } } else { - $this->oci8RaiseError(NULL, - 'Do query: Could not parse query'); + return $this->oci8RaiseError(NULL, 'Do query: Could not parse query'); } } - for(reset($descriptors), $descriptor = 0;$descriptor < count($descriptors);$descriptor++, next($descriptors)) { + for(reset($descriptors), $descriptor = 0; + $descriptor < count($descriptors); + $descriptor++, next($descriptors)) + { @OCIFreeDesc($descriptors[key($descriptors)]); } return($result); @@ -499,7 +510,7 @@ $limit = $this->selected_row_limit; $this->first_selected_row = $this->selected_row_limit = 0; if (!$this->connect($this->user, $this->password, $this->persistent)) { - return($this->raiseError()) + return($this->raiseError()); } return($this->_doQuery($query, $first, $limit)); } @@ -524,7 +535,7 @@ $limit = $this->selected_row_limit; $this->first_selected_row = $this->selected_row_limit = 0; if (!$this->connect($this->user, $this->password, $this->persistent)) { - return($this->raiseError()) + return($this->raiseError()); } return($this->_doQuery($query, $first, $limit, $prepared_query)); } @@ -633,7 +644,7 @@ return($this->highest_fetched_row[$result_value] >= $this->rows[$result_value]-1); } if (isset($this->row_buffer[$result_value])) { - return($this->raiseError()) + return($this->raiseError()); } if (isset($this->limits[$result_value])) { if (!$this->_skipFirstRows($result) || $this->current_row[$result_value] + 1 >= $this->limits[$result_value][1]) { @@ -642,7 +653,7 @@ } } if (OCIFetchInto($result, $this->row_buffer[$result_value])) { - return($this->raiseError()) + return($this->raiseError()); } unset($this->row_buffer[$result_value]); $this->rows[$result_value] = $this->current_row[$result_value] + 1; @@ -673,7 +684,7 @@ $lob_object = $this->fetchResult($result, $row, $field); if (gettype($lob_object) != "object") { if (($column = $this->GetColumn($result, $field)) == -1) { - return($this->raiseError()) + return($this->raiseError()); } if (isset($this->results[intval($result)][$row][$column])) { return $this->raiseError(MDB_ERROR, '', '', @@ -762,8 +773,8 @@ function resultIsNull($result, $row, $field) { $result_value = intval($result); - if (($column = $this->GetColumn($result, $field)) == -1 || !$this->fetchRow($result, $row)) { - return($this->raiseError()) + if (($column = $this->getColumn($result, $field)) == -1 || !$this->fetchRow($result, $row)) { + return($this->raiseError()); } $this->highest_fetched_row[$result_value] = max($this->highest_fetched_row[$result_value], $row); return(!isset($this->results[$result_value][$row][$column])); @@ -823,12 +834,12 @@ } if (!isset($this->rows[$result_value])) { if (!$this->getColumnNames($result, $column_names)) { - return($this->raiseError()) + return($this->raiseError()); } if (isset($this->limits[$result_value])) { if (!$this->_skipFirstRows($result)) { $this->rows[$result_value] = 0; - return($this->raiseError()) + return($this->raiseError()); } $limit = $this->limits[$result_value][1]; } else { @@ -1379,7 +1390,7 @@ function nextId($seq_name, $ondemand = FALSE) { if (!$this->connect($this->user, $this->password, $this->persistent)) { - return($this->raiseError()) + return($this->raiseError()); } $sequence_name = $this->getSequenceName($seq_name); $repeat = 0; @@ -1419,7 +1430,7 @@ function fetchInto($result, $fetchmode = MDB_FETCHMODE_DEFAULT, $rownum = NULL) { if (!$this->fetchRow($result, $row)) { - return($this->raiseError()) + return($this->raiseError()); } $result_value = intval($result); $array = $this->results[$result_value][$row];
« previous php.pear.cvs (#8334) next »