cvs: pear /DB/DB common.php dbase.php fbsql.php ibase.php ifx.php msql.php mssql.php mysql.php mysql4.php oci8.php odbc.php pgsql.php sqlite.php
sybase.php
| From: | Daniel Convissor | Date: | Wed, 18 Feb 2004 05:37:32 +0000 |
| Subject: | cvs: pear /DB/DB common.php dbase.php fbsql.php ibase.php ifx.php msql.php mssql.php mysql.php mysql4.php oci8.php odbc.php pgsql.php sqlite.php sybase.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-16636@lists.php.net to get a copy of this message | ||
danielc Wed Feb 18 00:37:32 2004 EDT
Modified files:
/pear/DB/DB common.php dbase.php fbsql.php ibase.php ifx.php
msql.php mssql.php mysql.php mysql4.php oci8.php
odbc.php pgsql.php sqlite.php sybase.php
Log:
Add DB_PORTABILITY_NULL_TO_EMPTY mode. Even though created because of Oracle, added to each
driver's fetchInto() to make nulls consistent across all platforms.
http://cvs.php.net/diff.php/pear/DB/DB/common.php?r1=1.88&r2=1.89&ty=u Index: pear/DB/DB/common.php diff -u pear/DB/DB/common.php:1.88 pear/DB/DB/common.php:1.89 --- pear/DB/DB/common.php:1.88 Wed Feb 11 10:40:31 2004 +++ pear/DB/DB/common.php Wed Feb 18 00:37:31 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: common.php,v 1.88 2004/02/11 15:40:31 danielc Exp $ +// $Id: common.php,v 1.89 2004/02/18 05:37:31 danielc Exp $ require_once 'PEAR.php'; @@ -27,7 +27,7 @@ * inherited by all such * * @package DB - * @version $Id: common.php,v 1.88 2004/02/11 15:40:31 danielc Exp $ + * @version $Id: common.php,v 1.89 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> * @author Tomas V.V.Cox <cox@idecnet.com> @@ -638,6 +638,12 @@ * DB_ERROR_MISMATCH -> DB_ERROR_NOSUCHFIELD * * + * <samp>DB_PORTABILITY_NULL_TO_EMPTY</samp> + * convert null values to empty strings in data output by get*() and + * fetch*(). Needed because Oracle considers empty strings to be null, + * while most other DBMS's know the difference between empty and null. + * + * * <samp>DB_PORTABILITY_ALL</samp> * turn on all portability features * @@ -1986,6 +1992,24 @@ } // }}} + // {{{ _convertNullArrayValuesToEmpty() + + /** + * Convert all null values in an array to empty strings + * + * @param array $array the array to be de-nullified (passed by reference) + * @return void + * @access private + */ + function _convertNullArrayValuesToEmpty(&$array) { + foreach ($array as $key => $value) { + if (is_null($value)) { + $array[$key] = ''; + } + } + } + + // }}} } /* http://cvs.php.net/diff.php/pear/DB/DB/dbase.php?r1=1.15&r2=1.16&ty=u Index: pear/DB/DB/dbase.php diff -u pear/DB/DB/dbase.php:1.15 pear/DB/DB/dbase.php:1.16 --- pear/DB/DB/dbase.php:1.15 Tue Feb 3 20:42:05 2004 +++ pear/DB/DB/dbase.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: dbase.php,v 1.15 2004/02/04 01:42:05 danielc Exp $ +// $Id: dbase.php,v 1.16 2004/02/18 05:37:31 danielc Exp $ // XXX legend: @@ -31,7 +31,7 @@ * extension. * * @package DB - * @version $Id: dbase.php,v 1.15 2004/02/04 01:42:05 danielc Exp $ + * @version $Id: dbase.php,v 1.16 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> */ @@ -151,6 +151,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/fbsql.php?r1=1.30&r2=1.31&ty=u Index: pear/DB/DB/fbsql.php diff -u pear/DB/DB/fbsql.php:1.30 pear/DB/DB/fbsql.php:1.31 --- pear/DB/DB/fbsql.php:1.30 Tue Feb 10 14:22:01 2004 +++ pear/DB/DB/fbsql.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.30 2004/02/10 19:22:01 danielc Exp $ +// $Id: fbsql.php,v 1.31 2004/02/18 05:37:31 danielc Exp $ // XXX legend: @@ -37,7 +37,7 @@ * extension. * * @package DB - * @version $Id: fbsql.php,v 1.30 2004/02/10 19:22:01 danielc Exp $ + * @version $Id: fbsql.php,v 1.31 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Frank M. Kromann <frank@frontbase.com> */ @@ -258,6 +258,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/ibase.php?r1=1.60&r2=1.61&ty=u Index: pear/DB/DB/ibase.php diff -u pear/DB/DB/ibase.php:1.60 pear/DB/DB/ibase.php:1.61 --- pear/DB/DB/ibase.php:1.60 Tue Feb 10 16:44:41 2004 +++ pear/DB/DB/ibase.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.60 2004/02/10 21:44:41 danielc Exp $ +// $Id: ibase.php,v 1.61 2004/02/18 05:37:31 danielc Exp $ // Bugs: @@ -31,7 +31,7 @@ * extension. * * @package DB - * @version $Id: ibase.php,v 1.60 2004/02/10 21:44:41 danielc Exp $ + * @version $Id: ibase.php,v 1.61 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> */ @@ -246,6 +246,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/ifx.php?r1=1.40&r2=1.41&ty=u Index: pear/DB/DB/ifx.php diff -u pear/DB/DB/ifx.php:1.40 pear/DB/DB/ifx.php:1.41 --- pear/DB/DB/ifx.php:1.40 Sun Feb 15 11:58:20 2004 +++ pear/DB/DB/ifx.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: ifx.php,v 1.40 2004/02/15 16:58:20 danielc Exp $ +// $Id: ifx.php,v 1.41 2004/02/18 05:37:31 danielc Exp $ // Legend: @@ -36,7 +36,7 @@ * extension. * * @package DB - * @version $Id: ifx.php,v 1.40 2004/02/15 16:58:20 danielc Exp $ + * @version $Id: ifx.php,v 1.41 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Tomas V.V.Cox <cox@idecnet.com> */ @@ -271,6 +271,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/msql.php?r1=1.21&r2=1.22&ty=u Index: pear/DB/DB/msql.php diff -u pear/DB/DB/msql.php:1.21 pear/DB/DB/msql.php:1.22 --- pear/DB/DB/msql.php:1.21 Tue Feb 3 20:42:05 2004 +++ pear/DB/DB/msql.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: msql.php,v 1.21 2004/02/04 01:42:05 danielc Exp $ +// $Id: msql.php,v 1.22 2004/02/18 05:37:31 danielc Exp $ require_once 'DB/common.php'; @@ -26,7 +26,7 @@ * extension. * * @package DB - * @version $Id: msql.php,v 1.21 2004/02/04 01:42:05 danielc Exp $ + * @version $Id: msql.php,v 1.22 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> */ @@ -177,6 +177,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/mssql.php?r1=1.49&r2=1.50&ty=u Index: pear/DB/DB/mssql.php diff -u pear/DB/DB/mssql.php:1.49 pear/DB/DB/mssql.php:1.50 --- pear/DB/DB/mssql.php:1.49 Tue Feb 10 10:56:37 2004 +++ pear/DB/DB/mssql.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.49 2004/02/10 15:56:37 danielc Exp $ +// $Id: mssql.php,v 1.50 2004/02/18 05:37:31 danielc Exp $ require_once 'DB/common.php'; @@ -26,7 +26,7 @@ * extension. * * @package DB - * @version $Id: mssql.php,v 1.49 2004/02/10 15:56:37 danielc Exp $ + * @version $Id: mssql.php,v 1.50 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> */ @@ -213,6 +213,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/mysql.php?r1=1.59&r2=1.60&ty=u Index: pear/DB/DB/mysql.php diff -u pear/DB/DB/mysql.php:1.59 pear/DB/DB/mysql.php:1.60 --- pear/DB/DB/mysql.php:1.59 Tue Feb 10 21:00:30 2004 +++ pear/DB/DB/mysql.php Wed Feb 18 00:37:32 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.59 2004/02/11 02:00:30 danielc Exp $ +// $Id: mysql.php,v 1.60 2004/02/18 05:37:32 danielc Exp $ // XXX legend: @@ -39,7 +39,7 @@ * This is for MySQL versions 4.0 and below. * * @package DB - * @version $Id: mysql.php,v 1.59 2004/02/11 02:00:30 danielc Exp $ + * @version $Id: mysql.php,v 1.60 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> */ @@ -318,6 +318,9 @@ */ $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/mysql4.php?r1=1.48&r2=1.49&ty=u Index: pear/DB/DB/mysql4.php diff -u pear/DB/DB/mysql4.php:1.48 pear/DB/DB/mysql4.php:1.49 --- pear/DB/DB/mysql4.php:1.48 Tue Feb 10 21:00:30 2004 +++ pear/DB/DB/mysql4.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mysql4.php,v 1.48 2004/02/11 02:00:30 danielc Exp $ +// $Id: mysql4.php,v 1.49 2004/02/18 05:37:32 danielc Exp $ // NOTE: The tableInfo() method must be redone because the functions it @@ -38,7 +38,7 @@ * Note that persistent connections no longer exist. * * @package DB - * @version $Id: mysql4.php,v 1.48 2004/02/11 02:00:30 danielc Exp $ + * @version $Id: mysql4.php,v 1.49 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Chaillan Nicolas <nicos@php.net> */ @@ -314,6 +314,9 @@ */ $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/oci8.php?r1=1.56&r2=1.57&ty=u Index: pear/DB/DB/oci8.php diff -u pear/DB/DB/oci8.php:1.56 pear/DB/DB/oci8.php:1.57 --- pear/DB/DB/oci8.php:1.56 Tue Feb 10 13:59:44 2004 +++ pear/DB/DB/oci8.php Wed Feb 18 00:37:32 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: oci8.php,v 1.56 2004/02/10 18:59:44 danielc Exp $ +// $Id: oci8.php,v 1.57 2004/02/18 05:37:32 danielc Exp $ // be aware... OCIError() only appears to return anything when given a @@ -34,7 +34,7 @@ * Definitely works with versions 8 and 9 of Oracle. * * @package DB - * @version $Id: oci8.php,v 1.56 2004/02/10 18:59:44 danielc Exp $ + * @version $Id: oci8.php,v 1.57 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author James L. Pine <jlp@valinux.com> */ @@ -229,6 +229,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/odbc.php?r1=1.39&r2=1.40&ty=u Index: pear/DB/DB/odbc.php diff -u pear/DB/DB/odbc.php:1.39 pear/DB/DB/odbc.php:1.40 --- pear/DB/DB/odbc.php:1.39 Tue Feb 10 21:00:30 2004 +++ pear/DB/DB/odbc.php Wed Feb 18 00:37:32 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: odbc.php,v 1.39 2004/02/11 02:00:30 danielc Exp $ +// $Id: odbc.php,v 1.40 2004/02/18 05:37:32 danielc Exp $ // XXX legend: @@ -35,7 +35,7 @@ * extension. * * @package DB - * @version $Id: odbc.php,v 1.39 2004/02/11 02:00:30 danielc Exp $ + * @version $Id: odbc.php,v 1.40 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> */ @@ -277,6 +277,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/pgsql.php?r1=1.69&r2=1.70&ty=u Index: pear/DB/DB/pgsql.php diff -u pear/DB/DB/pgsql.php:1.69 pear/DB/DB/pgsql.php:1.70 --- pear/DB/DB/pgsql.php:1.69 Tue Feb 10 10:56:37 2004 +++ pear/DB/DB/pgsql.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.69 2004/02/10 15:56:37 danielc Exp $ +// $Id: pgsql.php,v 1.70 2004/02/18 05:37:32 danielc Exp $ require_once 'DB/common.php'; @@ -27,7 +27,7 @@ * extension. * * @package DB - * @version $Id: pgsql.php,v 1.69 2004/02/10 15:56:37 danielc Exp $ + * @version $Id: pgsql.php,v 1.70 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Rui Hirokawa <hirokawa@php.net> * @author Stig Bakken <ssb@php.net> @@ -303,6 +303,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } $this->row[$result] = ++$rownum; return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/sqlite.php?r1=1.52&r2=1.53&ty=u Index: pear/DB/DB/sqlite.php diff -u pear/DB/DB/sqlite.php:1.52 pear/DB/DB/sqlite.php:1.53 --- pear/DB/DB/sqlite.php:1.52 Mon Feb 9 22:32:07 2004 +++ pear/DB/DB/sqlite.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.52 2004/02/10 03:32:07 danielc Exp $ +// $Id: sqlite.php,v 1.53 2004/02/18 05:37:32 danielc Exp $ // SQLite function set: @@ -75,7 +75,7 @@ * PECL extension. * * @package DB - * @version $Id: sqlite.php,v 1.52 2004/02/10 03:32:07 danielc Exp $ + * @version $Id: sqlite.php,v 1.53 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Urs Gehrig <urs@circle.ch> * @author Mika Tuupola <tuupola@appelsiini.net> @@ -320,6 +320,9 @@ */ $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/sybase.php?r1=1.46&r2=1.47&ty=u Index: pear/DB/DB/sybase.php diff -u pear/DB/DB/sybase.php:1.46 pear/DB/DB/sybase.php:1.47 --- pear/DB/DB/sybase.php:1.46 Tue Feb 10 10:56:37 2004 +++ pear/DB/DB/sybase.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: sybase.php,v 1.46 2004/02/10 15:56:37 danielc Exp $ +// $Id: sybase.php,v 1.47 2004/02/18 05:37:32 danielc Exp $ // TODO @@ -33,7 +33,7 @@ * extension. * * @package DB - * @version $Id: sybase.php,v 1.46 2004/02/10 15:56:37 danielc Exp $ + * @version $Id: sybase.php,v 1.47 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> * @author Antônio Carlos Venâncio Júnior <floripa@php.net> @@ -351,6 +351,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; }
http://cvs.php.net/diff.php/pear/DB/DB/common.php?r1=1.88&r2=1.89&ty=u Index: pear/DB/DB/common.php diff -u pear/DB/DB/common.php:1.88 pear/DB/DB/common.php:1.89 --- pear/DB/DB/common.php:1.88 Wed Feb 11 10:40:31 2004 +++ pear/DB/DB/common.php Wed Feb 18 00:37:31 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: common.php,v 1.88 2004/02/11 15:40:31 danielc Exp $ +// $Id: common.php,v 1.89 2004/02/18 05:37:31 danielc Exp $ require_once 'PEAR.php'; @@ -27,7 +27,7 @@ * inherited by all such * * @package DB - * @version $Id: common.php,v 1.88 2004/02/11 15:40:31 danielc Exp $ + * @version $Id: common.php,v 1.89 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> * @author Tomas V.V.Cox <cox@idecnet.com> @@ -638,6 +638,12 @@ * DB_ERROR_MISMATCH -> DB_ERROR_NOSUCHFIELD * * + * <samp>DB_PORTABILITY_NULL_TO_EMPTY</samp> + * convert null values to empty strings in data output by get*() and + * fetch*(). Needed because Oracle considers empty strings to be null, + * while most other DBMS's know the difference between empty and null. + * + * * <samp>DB_PORTABILITY_ALL</samp> * turn on all portability features * @@ -1986,6 +1992,24 @@ } // }}} + // {{{ _convertNullArrayValuesToEmpty() + + /** + * Convert all null values in an array to empty strings + * + * @param array $array the array to be de-nullified (passed by reference) + * @return void + * @access private + */ + function _convertNullArrayValuesToEmpty(&$array) { + foreach ($array as $key => $value) { + if (is_null($value)) { + $array[$key] = ''; + } + } + } + + // }}} } /* http://cvs.php.net/diff.php/pear/DB/DB/dbase.php?r1=1.15&r2=1.16&ty=u Index: pear/DB/DB/dbase.php diff -u pear/DB/DB/dbase.php:1.15 pear/DB/DB/dbase.php:1.16 --- pear/DB/DB/dbase.php:1.15 Tue Feb 3 20:42:05 2004 +++ pear/DB/DB/dbase.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: dbase.php,v 1.15 2004/02/04 01:42:05 danielc Exp $ +// $Id: dbase.php,v 1.16 2004/02/18 05:37:31 danielc Exp $ // XXX legend: @@ -31,7 +31,7 @@ * extension. * * @package DB - * @version $Id: dbase.php,v 1.15 2004/02/04 01:42:05 danielc Exp $ + * @version $Id: dbase.php,v 1.16 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> */ @@ -151,6 +151,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/fbsql.php?r1=1.30&r2=1.31&ty=u Index: pear/DB/DB/fbsql.php diff -u pear/DB/DB/fbsql.php:1.30 pear/DB/DB/fbsql.php:1.31 --- pear/DB/DB/fbsql.php:1.30 Tue Feb 10 14:22:01 2004 +++ pear/DB/DB/fbsql.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.30 2004/02/10 19:22:01 danielc Exp $ +// $Id: fbsql.php,v 1.31 2004/02/18 05:37:31 danielc Exp $ // XXX legend: @@ -37,7 +37,7 @@ * extension. * * @package DB - * @version $Id: fbsql.php,v 1.30 2004/02/10 19:22:01 danielc Exp $ + * @version $Id: fbsql.php,v 1.31 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Frank M. Kromann <frank@frontbase.com> */ @@ -258,6 +258,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/ibase.php?r1=1.60&r2=1.61&ty=u Index: pear/DB/DB/ibase.php diff -u pear/DB/DB/ibase.php:1.60 pear/DB/DB/ibase.php:1.61 --- pear/DB/DB/ibase.php:1.60 Tue Feb 10 16:44:41 2004 +++ pear/DB/DB/ibase.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.60 2004/02/10 21:44:41 danielc Exp $ +// $Id: ibase.php,v 1.61 2004/02/18 05:37:31 danielc Exp $ // Bugs: @@ -31,7 +31,7 @@ * extension. * * @package DB - * @version $Id: ibase.php,v 1.60 2004/02/10 21:44:41 danielc Exp $ + * @version $Id: ibase.php,v 1.61 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> */ @@ -246,6 +246,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/ifx.php?r1=1.40&r2=1.41&ty=u Index: pear/DB/DB/ifx.php diff -u pear/DB/DB/ifx.php:1.40 pear/DB/DB/ifx.php:1.41 --- pear/DB/DB/ifx.php:1.40 Sun Feb 15 11:58:20 2004 +++ pear/DB/DB/ifx.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: ifx.php,v 1.40 2004/02/15 16:58:20 danielc Exp $ +// $Id: ifx.php,v 1.41 2004/02/18 05:37:31 danielc Exp $ // Legend: @@ -36,7 +36,7 @@ * extension. * * @package DB - * @version $Id: ifx.php,v 1.40 2004/02/15 16:58:20 danielc Exp $ + * @version $Id: ifx.php,v 1.41 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Tomas V.V.Cox <cox@idecnet.com> */ @@ -271,6 +271,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/msql.php?r1=1.21&r2=1.22&ty=u Index: pear/DB/DB/msql.php diff -u pear/DB/DB/msql.php:1.21 pear/DB/DB/msql.php:1.22 --- pear/DB/DB/msql.php:1.21 Tue Feb 3 20:42:05 2004 +++ pear/DB/DB/msql.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: msql.php,v 1.21 2004/02/04 01:42:05 danielc Exp $ +// $Id: msql.php,v 1.22 2004/02/18 05:37:31 danielc Exp $ require_once 'DB/common.php'; @@ -26,7 +26,7 @@ * extension. * * @package DB - * @version $Id: msql.php,v 1.21 2004/02/04 01:42:05 danielc Exp $ + * @version $Id: msql.php,v 1.22 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> */ @@ -177,6 +177,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/mssql.php?r1=1.49&r2=1.50&ty=u Index: pear/DB/DB/mssql.php diff -u pear/DB/DB/mssql.php:1.49 pear/DB/DB/mssql.php:1.50 --- pear/DB/DB/mssql.php:1.49 Tue Feb 10 10:56:37 2004 +++ pear/DB/DB/mssql.php Wed Feb 18 00:37:31 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.49 2004/02/10 15:56:37 danielc Exp $ +// $Id: mssql.php,v 1.50 2004/02/18 05:37:31 danielc Exp $ require_once 'DB/common.php'; @@ -26,7 +26,7 @@ * extension. * * @package DB - * @version $Id: mssql.php,v 1.49 2004/02/10 15:56:37 danielc Exp $ + * @version $Id: mssql.php,v 1.50 2004/02/18 05:37:31 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> */ @@ -213,6 +213,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/mysql.php?r1=1.59&r2=1.60&ty=u Index: pear/DB/DB/mysql.php diff -u pear/DB/DB/mysql.php:1.59 pear/DB/DB/mysql.php:1.60 --- pear/DB/DB/mysql.php:1.59 Tue Feb 10 21:00:30 2004 +++ pear/DB/DB/mysql.php Wed Feb 18 00:37:32 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.59 2004/02/11 02:00:30 danielc Exp $ +// $Id: mysql.php,v 1.60 2004/02/18 05:37:32 danielc Exp $ // XXX legend: @@ -39,7 +39,7 @@ * This is for MySQL versions 4.0 and below. * * @package DB - * @version $Id: mysql.php,v 1.59 2004/02/11 02:00:30 danielc Exp $ + * @version $Id: mysql.php,v 1.60 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> */ @@ -318,6 +318,9 @@ */ $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/mysql4.php?r1=1.48&r2=1.49&ty=u Index: pear/DB/DB/mysql4.php diff -u pear/DB/DB/mysql4.php:1.48 pear/DB/DB/mysql4.php:1.49 --- pear/DB/DB/mysql4.php:1.48 Tue Feb 10 21:00:30 2004 +++ pear/DB/DB/mysql4.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mysql4.php,v 1.48 2004/02/11 02:00:30 danielc Exp $ +// $Id: mysql4.php,v 1.49 2004/02/18 05:37:32 danielc Exp $ // NOTE: The tableInfo() method must be redone because the functions it @@ -38,7 +38,7 @@ * Note that persistent connections no longer exist. * * @package DB - * @version $Id: mysql4.php,v 1.48 2004/02/11 02:00:30 danielc Exp $ + * @version $Id: mysql4.php,v 1.49 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Chaillan Nicolas <nicos@php.net> */ @@ -314,6 +314,9 @@ */ $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/oci8.php?r1=1.56&r2=1.57&ty=u Index: pear/DB/DB/oci8.php diff -u pear/DB/DB/oci8.php:1.56 pear/DB/DB/oci8.php:1.57 --- pear/DB/DB/oci8.php:1.56 Tue Feb 10 13:59:44 2004 +++ pear/DB/DB/oci8.php Wed Feb 18 00:37:32 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: oci8.php,v 1.56 2004/02/10 18:59:44 danielc Exp $ +// $Id: oci8.php,v 1.57 2004/02/18 05:37:32 danielc Exp $ // be aware... OCIError() only appears to return anything when given a @@ -34,7 +34,7 @@ * Definitely works with versions 8 and 9 of Oracle. * * @package DB - * @version $Id: oci8.php,v 1.56 2004/02/10 18:59:44 danielc Exp $ + * @version $Id: oci8.php,v 1.57 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author James L. Pine <jlp@valinux.com> */ @@ -229,6 +229,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/odbc.php?r1=1.39&r2=1.40&ty=u Index: pear/DB/DB/odbc.php diff -u pear/DB/DB/odbc.php:1.39 pear/DB/DB/odbc.php:1.40 --- pear/DB/DB/odbc.php:1.39 Tue Feb 10 21:00:30 2004 +++ pear/DB/DB/odbc.php Wed Feb 18 00:37:32 2004 @@ -17,7 +17,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: odbc.php,v 1.39 2004/02/11 02:00:30 danielc Exp $ +// $Id: odbc.php,v 1.40 2004/02/18 05:37:32 danielc Exp $ // XXX legend: @@ -35,7 +35,7 @@ * extension. * * @package DB - * @version $Id: odbc.php,v 1.39 2004/02/11 02:00:30 danielc Exp $ + * @version $Id: odbc.php,v 1.40 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Stig Bakken <ssb@php.net> */ @@ -277,6 +277,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/pgsql.php?r1=1.69&r2=1.70&ty=u Index: pear/DB/DB/pgsql.php diff -u pear/DB/DB/pgsql.php:1.69 pear/DB/DB/pgsql.php:1.70 --- pear/DB/DB/pgsql.php:1.69 Tue Feb 10 10:56:37 2004 +++ pear/DB/DB/pgsql.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.69 2004/02/10 15:56:37 danielc Exp $ +// $Id: pgsql.php,v 1.70 2004/02/18 05:37:32 danielc Exp $ require_once 'DB/common.php'; @@ -27,7 +27,7 @@ * extension. * * @package DB - * @version $Id: pgsql.php,v 1.69 2004/02/10 15:56:37 danielc Exp $ + * @version $Id: pgsql.php,v 1.70 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Rui Hirokawa <hirokawa@php.net> * @author Stig Bakken <ssb@php.net> @@ -303,6 +303,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } $this->row[$result] = ++$rownum; return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/sqlite.php?r1=1.52&r2=1.53&ty=u Index: pear/DB/DB/sqlite.php diff -u pear/DB/DB/sqlite.php:1.52 pear/DB/DB/sqlite.php:1.53 --- pear/DB/DB/sqlite.php:1.52 Mon Feb 9 22:32:07 2004 +++ pear/DB/DB/sqlite.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.52 2004/02/10 03:32:07 danielc Exp $ +// $Id: sqlite.php,v 1.53 2004/02/18 05:37:32 danielc Exp $ // SQLite function set: @@ -75,7 +75,7 @@ * PECL extension. * * @package DB - * @version $Id: sqlite.php,v 1.52 2004/02/10 03:32:07 danielc Exp $ + * @version $Id: sqlite.php,v 1.53 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Urs Gehrig <urs@circle.ch> * @author Mika Tuupola <tuupola@appelsiini.net> @@ -320,6 +320,9 @@ */ $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; } http://cvs.php.net/diff.php/pear/DB/DB/sybase.php?r1=1.46&r2=1.47&ty=u Index: pear/DB/DB/sybase.php diff -u pear/DB/DB/sybase.php:1.46 pear/DB/DB/sybase.php:1.47 --- pear/DB/DB/sybase.php:1.46 Tue Feb 10 10:56:37 2004 +++ pear/DB/DB/sybase.php Wed Feb 18 00:37:32 2004 @@ -18,7 +18,7 @@ // | Maintainer: Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: sybase.php,v 1.46 2004/02/10 15:56:37 danielc Exp $ +// $Id: sybase.php,v 1.47 2004/02/18 05:37:32 danielc Exp $ // TODO @@ -33,7 +33,7 @@ * extension. * * @package DB - * @version $Id: sybase.php,v 1.46 2004/02/10 15:56:37 danielc Exp $ + * @version $Id: sybase.php,v 1.47 2004/02/18 05:37:32 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> * @author Antônio Carlos Venâncio Júnior <floripa@php.net> @@ -351,6 +351,9 @@ if ($this->options['portability'] & DB_PORTABILITY_RTRIM) { $this->_rtrimArrayValues($arr); } + if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) { + $this->_convertNullArrayValuesToEmpty($arr); + } return DB_OK; }