cvs: pear(MDB_1) /MDB/MDB fbsql.php

From: Date: Mon, 16 Feb 2004 08:56:16 +0000
Subject: cvs: pear(MDB_1) /MDB/MDB fbsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-16600@lists.php.net to get a copy of this message
lsmith Mon Feb 16 03:56:16 2004 EDT Modified files: (Branch: MDB_1) /pear/MDB/MDB fbsql.php Log: - silenced error messages - cosmetic fixes

http://cvs.php.net/diff.php/pear/MDB/MDB/fbsql.php?r1=1.16.4.11&r2=1.16.4.12&ty=u Index: pear/MDB/MDB/fbsql.php diff -u pear/MDB/MDB/fbsql.php:1.16.4.11 pear/MDB/MDB/fbsql.php:1.16.4.12 --- pear/MDB/MDB/fbsql.php:1.16.4.11 Sun Feb 15 11:36:08 2004 +++ pear/MDB/MDB/fbsql.php Mon Feb 16 03:56:14 2004 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.16.4.11 2004/02/15 16:36:08 lsmith Exp $ +// $Id: fbsql.php,v 1.16.4.12 2004/02/16 08:56:14 lsmith Exp $ // require_once('MDB/Common.php'); @@ -134,7 +134,7 @@ */ function errorNative() { - return fbsql_errno($this->connection); + return @fbsql_errno($this->connection); } // }}} @@ -153,7 +153,7 @@ function fbsqlRaiseError($errno = NULL) { if ($errno == NULL) { - $errno = $this->errorCode(fbsql_errno($this->connection)); + $errno = $this->errorCode(@fbsql_errno($this->connection)); } return($this->raiseError($errno, NULL, NULL, NULL, @fbsql_error($this->connection))); } @@ -280,7 +280,7 @@ { return(MDB_OK); } - fbsql_close($this->connection); + @fbsql_close($this->connection); $this->connection = 0; $this->affected_rows = -1; } @@ -306,8 +306,8 @@ } if (isset($this->supported['Transactions']) && !$this->auto_commit) { - if (!fbsql_query('SET AUTOCOMMIT FALSE;', $this->connection)) { - fbsql_close($this->connection); + if (!@fbsql_query('SET AUTOCOMMIT FALSE;', $this->connection)) { + @fbsql_close($this->connection); $this->connection = 0; $this->affected_rows = -1; return($this->raiseError()); @@ -336,7 +336,7 @@ if (isset($this->supported['Transactions']) && !$this->auto_commit) { $result = $this->autoCommit(TRUE); } - fbsql_close($this->connection); + @fbsql_close($this->connection); $this->connection = 0; $this->affected_rows = -1; if (isset($result) && MDB::isError($result)) { @@ -383,16 +383,16 @@ } if ($this->database_name != '') { - if(!fbsql_select_db($this->database_name, $this->connection)) { + if(!@fbsql_select_db($this->database_name, $this->connection)) { return($this->fbsqlRaiseError()); } } // Add ; to the end of the query. This is required by FrontBase $query .= ';'; - if ($result = fbsql_query($query, $this->connection)) { + if ($result = @fbsql_query($query, $this->connection)) { if ($ismanip) { - $this->affected_rows = fbsql_affected_rows($this->connection); + $this->affected_rows = @fbsql_affected_rows($this->connection); return(MDB_OK); } else { $result_value = intval($result); @@ -440,9 +440,10 @@ } if (!isset($this->columns[$result_value])) { $this->columns[$result_value] = array(); - $columns = fbsql_num_fields($result); + $columns = @fbsql_num_fields($result); for($column = 0; $column < $columns; $column++) { - $this->columns[$result_value][strtolower(fbsql_field_name($result, $column))] = $column; + $field_name = strtolower(@fbsql_field_name($result, $column)); + $this->columns[$result_value][$field_name] = $column; } } return($this->columns[$result_value]); @@ -465,7 +466,7 @@ return($this->raiseError(MDB_ERROR_INVALID, NULL, NULL, 'numCols: it was specified an inexisting result set')); } - return(fbsql_num_fields($result)); + return(@fbsql_num_fields($result)); } // }}} @@ -503,7 +504,8 @@ function fetch($result, $row, $field) { $result_value = intval($result); - $this->highest_fetched_row[$result_value] = max($this->highest_fetched_row[$result_value], $row); + $this->highest_fetched_row[$result_value] = + max($this->highest_fetched_row[$result_value], $row); if (is_string($field)) { if (intval($field) != $field) { $field = strtoupper($field); @@ -598,7 +600,7 @@ */ function numRows($result) { - return(fbsql_num_rows($result)); + return(@fbsql_num_rows($result)); } // }}} @@ -623,7 +625,7 @@ if(isset($this->result_types[$result_value])) { unset($this->result_types[$result_value]); } - return(fbsql_free_result($result)); + return(@fbsql_free_result($result)); } // }}} @@ -661,7 +663,9 @@ $this->warnings[] = "unsigned integer field \"$name\" is being declared as signed integer"; } - return("$name INT".(isset($field["default"]) ? " DEFAULT ".$field["default"] : "").(isset($field["notnull"]) ? " NOT NULL" : "")); + return("$name INT".(isset($field["default"]) + ? " DEFAULT ".$field["default"] + : "").(isset($field["notnull"]) ? " NOT NULL" : "")); } // }}} @@ -693,7 +697,11 @@ */ function getTextDeclaration($name, $field) { - return((isset($field["length"]) ? "$name VARCHAR (".$field["length"].")" : "$name VARCHAR($this->max_text_length)").(isset($field["default"]) ? " DEFAULT ".$this->GetTextValue($field["default"]) : "").(isset($field["notnull"]) ? " NOT NULL" : "")); + return((isset($field["length"]) + ? "$name VARCHAR (".$field["length"].")" + : "$name VARCHAR(".$this->max_text_length.")").(isset($field["default"]) + ? " DEFAULT ".$this->GetTextValue($field["default"]) + : "").(isset($field["notnull"]) ? " NOT NULL" : "")); } // }}} @@ -784,7 +792,9 @@ */ function getBooleanDeclaration($name, $field) { - return("$name BOOLEAN" . (isset($field['default']) ? ' DEFAULT ' . $this->getBooleanValue($field['default']) : '') . (isset($field['notnull']) ? ' NOT NULL' : '')); + return("$name BOOLEAN" . (isset($field['default']) + ? ' DEFAULT ' . $this->getBooleanValue($field['default']) + : '') . (isset($field['notnull']) ? ' NOT NULL' : '')); } // }}} @@ -965,7 +975,8 @@ { $value = "'"; while(!$this->endOfLob($clob)) { - if (MDB::isError($result = $this->readLob($clob, $data, $this->options['lob_buffer_length']))) { + $result = $this->readLob($clob, $data, $this->options['lob_buffer_length']); + if (MDB::isError($result)) { return($result); } $value .= $this->_quote($data); @@ -1009,7 +1020,8 @@ { $value = "'"; while(!$this->endOfLob($blob)) { - if (MDB::isError($result = $this->readLob($blob, $data, $this->options['lob_buffer_length']))) { + $result = $this->readLob($blob, $data, $this->options['lob_buffer_length']); + if (MDB::isError($result)) { return($result); } $value .= addslashes($data); @@ -1134,7 +1146,9 @@ */ function getDecimalValue($value) { - return(($value === NULL) ? 'NULL' : strval(round(doubleval($value)*$this->decimal_factor))); + return(($value === NULL) + ? 'NULL' + : strval(round(doubleval($value)*$this->decimal_factor))); } // }}} @@ -1172,7 +1186,7 @@ return(1); } } - $value = intval(fbsql_insert_id()); + $value = intval(@fbsql_insert_id()); $res = $this->query("DELETE FROM $sequence_name WHERE sequence < $value"); if (MDB::isError($res)) { $this->warnings[] = 'Next ID: could not delete previous sequence table values'; @@ -1222,7 +1236,8 @@ if (!@fbsql_data_seek($result, $rownum)) { return(NULL); } - $this->highest_fetched_row[$result_value] = max($this->highest_fetched_row[$result_value], $rownum); + $this->highest_fetched_row[$result_value] = + max($this->highest_fetched_row[$result_value], $rownum); } if ($fetchmode == MDB_FETCHMODE_DEFAULT) { $fetchmode = $this->fetchmode; @@ -1259,7 +1274,7 @@ */ function nextResult($result) { - return(fbsql_next_result($result)); + return(@fbsql_next_result($result)); } // }}} @@ -1367,4 +1382,4 @@ } } -?> +?> \ No newline at end of file
« previous php.pear.cvs (#16600) next »