cvs: pear /MDB/MDB Common.php fbsql.php mssql.php mysql.php pgsql.php querysim.php /MDB/MDB/Modules Result.php
| From: | Lukas Smith | Date: | Tue, 23 Sep 2003 13:43:26 +0000 |
| Subject: | cvs: pear /MDB/MDB Common.php fbsql.php mssql.php mysql.php pgsql.php querysim.php /MDB/MDB/Modules Result.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-13018@lists.php.net to get a copy of this message | ||
lsmith Tue Sep 23 09:43:26 2003 EDT
Modified files:
/pear/MDB/MDB Common.php fbsql.php mssql.php mysql.php pgsql.php
querysim.php
/pear/MDB/MDB/Modules Result.php
Log:
lets get rid of all those $foo == null
Index: pear/MDB/MDB/Common.php
diff -u pear/MDB/MDB/Common.php:1.154 pear/MDB/MDB/Common.php:1.155
--- pear/MDB/MDB/Common.php:1.154 Mon Sep 22 05:47:32 2003
+++ pear/MDB/MDB/Common.php Tue Sep 23 09:43:25 2003
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.154 2003/09/22 09:47:32 lsmith Exp $
+// $Id: Common.php,v 1.155 2003/09/23 13:43:25 lsmith Exp $
/**
* @package MDB
@@ -1706,7 +1706,7 @@
}
for($column = 0; $column < $columns; $column++) {
$result = $this->fetch($result, $rownum, $column);
- if ($result == null) {
+ if (!is_array($result)) {
return null;
}
if (isset($column_names)) {
Index: pear/MDB/MDB/fbsql.php
diff -u pear/MDB/MDB/fbsql.php:1.45 pear/MDB/MDB/fbsql.php:1.46
--- pear/MDB/MDB/fbsql.php:1.45 Mon Sep 22 05:48:06 2003
+++ pear/MDB/MDB/fbsql.php Tue Sep 23 09:43:25 2003
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: fbsql.php,v 1.45 2003/09/22 09:48:06 lsmith Exp $
+// $Id: fbsql.php,v 1.46 2003/09/23 13:43:25 lsmith Exp $
//
require_once 'MDB/Common.php';
@@ -135,7 +135,7 @@
*/
function fbsqlRaiseError($errno = null)
{
- if ($errno == null) {
+ if (is_null($errno)) {
$errno = $this->errorCode(fbsql_errno($this->connection));
}
return $this->raiseError($errno, null, null, null,
@@ -645,7 +645,7 @@
function fetchRow($result, $fetchmode = MDB_FETCHMODE_DEFAULT, $rownum = null)
{
$result_value = intval($result);
- if ($rownum == null) {
+ if (is_null($rownum)) {
++$this->results[$result_value]['highest_fetched_row'];
} else {
if (!@fbsql_data_seek($result, $rownum)) {
Index: pear/MDB/MDB/mssql.php
diff -u pear/MDB/MDB/mssql.php:1.44 pear/MDB/MDB/mssql.php:1.45
--- pear/MDB/MDB/mssql.php:1.44 Mon Sep 22 05:48:06 2003
+++ pear/MDB/MDB/mssql.php Tue Sep 23 09:43:25 2003
@@ -43,7 +43,7 @@
// | Author: Frank M. Kromann <frank@kromann.info> |
// +----------------------------------------------------------------------+
//
-// $Id: mssql.php,v 1.44 2003/09/22 09:48:06 lsmith Exp $
+// $Id: mssql.php,v 1.45 2003/09/23 13:43:25 lsmith Exp $
//
require_once 'MDB/Common.php';
@@ -676,7 +676,7 @@
function fetchRow($result, $fetchmode = MDB_FETCHMODE_DEFAULT, $rownum = null)
{
$result_value = intval($result);
- if ($rownum == null) {
+ if (is_null($rownum)) {
++$this->results[$result_value]['highest_fetched_row'];
} else {
if (!@mssql_data_seek($result, $rownum)) {
Index: pear/MDB/MDB/mysql.php
diff -u pear/MDB/MDB/mysql.php:1.114 pear/MDB/MDB/mysql.php:1.115
--- pear/MDB/MDB/mysql.php:1.114 Mon Sep 22 05:48:06 2003
+++ pear/MDB/MDB/mysql.php Tue Sep 23 09:43:25 2003
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: mysql.php,v 1.114 2003/09/22 09:48:06 lsmith Exp $
+// $Id: mysql.php,v 1.115 2003/09/23 13:43:25 lsmith Exp $
//
require_once 'MDB/Common.php';
@@ -140,7 +140,7 @@
*/
function mysqlRaiseError($errno = null)
{
- if ($errno == null) {
+ if (is_null($errno)) {
$errno = $this->errorCode(mysql_errno($this->connection));
}
return $this->raiseError($errno, null, null, null,
@@ -831,7 +831,7 @@
function fetchRow($result, $fetchmode = MDB_FETCHMODE_DEFAULT, $rownum = null)
{
$result_value = intval($result);
- if ($rownum == null) {
+ if (is_null($rownum)) {
++$this->results[$result_value]['highest_fetched_row'];
} else {
if (!@mysql_data_seek($result, $rownum)) {
Index: pear/MDB/MDB/pgsql.php
diff -u pear/MDB/MDB/pgsql.php:1.96 pear/MDB/MDB/pgsql.php:1.97
--- pear/MDB/MDB/pgsql.php:1.96 Mon Sep 22 09:00:08 2003
+++ pear/MDB/MDB/pgsql.php Tue Sep 23 09:43:26 2003
@@ -42,7 +42,7 @@
// | Author: Paul Cooper <pgc@ucecom.com> |
// +----------------------------------------------------------------------+
//
-// $Id: pgsql.php,v 1.96 2003/09/22 13:00:08 lsmith Exp $
+// $Id: pgsql.php,v 1.97 2003/09/23 13:43:26 lsmith Exp $
require_once 'MDB/Common.php';
@@ -789,7 +789,7 @@
function fetchRow($result, $fetchmode = MDB_FETCHMODE_DEFAULT, $rownum = null)
{
$result_value = intval($result);
- if ($rownum == null) {
+ if (is_null($rownum)) {
++$this->results[$result_value]['highest_fetched_row'];
$rownum = $this->results[$result_value]['highest_fetched_row'];
} else {
Index: pear/MDB/MDB/querysim.php
diff -u pear/MDB/MDB/querysim.php:1.28 pear/MDB/MDB/querysim.php:1.29
--- pear/MDB/MDB/querysim.php:1.28 Mon Sep 22 05:48:06 2003
+++ pear/MDB/MDB/querysim.php Tue Sep 23 09:43:26 2003
@@ -60,7 +60,7 @@
// | please contact Alan Richmond. |
// +----------------------------------------------------------------------+
//
-// $Id: querysim.php,v 1.28 2003/09/22 09:48:06 lsmith Exp $
+// $Id: querysim.php,v 1.29 2003/09/23 13:43:26 lsmith Exp $
//
/*
@@ -695,7 +695,7 @@
{
$result_value = $this->_querySimSignature($result);
//if specific rownum request
- if ($rownum == null) {
+ if (is_null($rownum)) {
++$this->results[$result_value]['highest_fetched_row'];
$rownum = $this->results[$result_value]['highest_fetched_row'];
} else {
Index: pear/MDB/MDB/Modules/Result.php
diff -u pear/MDB/MDB/Modules/Result.php:1.7 pear/MDB/MDB/Modules/Result.php:1.8
--- pear/MDB/MDB/Modules/Result.php:1.7 Sun Sep 21 11:48:45 2003
+++ pear/MDB/MDB/Modules/Result.php Tue Sep 23 09:43:26 2003
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Result.php,v 1.7 2003/09/21 15:48:45 lsmith Exp $
+// $Id: Result.php,v 1.8 2003/09/23 13:43:26 lsmith Exp $
//
/**
@@ -106,7 +106,7 @@
$this->row_counter++;
$row = $this->dbh->fetchRow($this->result, $fetchmode, $rownum);
- if ($row == null && $this->autofree) {
+ if (is_null($row) && $this->autofree) {
$this->freeResult();
}
return $row;