cvs: pear /MDB2/MDB2/Driver/Datatype Common.php fbsql.php ibase.php mssql.php oci8.php pgsql.php

From: Date: Sun, 20 Aug 2006 08:35:52 +0000
Subject: cvs: pear /MDB2/MDB2/Driver/Datatype Common.php fbsql.php ibase.php mssql.php oci8.php pgsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-41754@lists.php.net to get a copy of this message
lsmith Sun Aug 20 08:35:52 2006 UTC Modified files: /pear/MDB2/MDB2/Driver/Datatype Common.php fbsql.php ibase.php mssql.php oci8.php pgsql.php Log: - fixed mode handling in convert methods and added missing phpdoc comments

http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/Common.php?r1=1.107&r2=1.108&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/Common.php diff -u pear/MDB2/MDB2/Driver/Datatype/Common.php:1.107 pear/MDB2/MDB2/Driver/Datatype/Common.php:1.108 --- pear/MDB2/MDB2/Driver/Datatype/Common.php:1.107 Sun Aug 20 08:20:55 2006 +++ pear/MDB2/MDB2/Driver/Datatype/Common.php Sun Aug 20 08:35:51 2006 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.107 2006/08/20 08:20:55 lsmith Exp $ +// $Id: Common.php,v 1.108 2006/08/20 08:35:51 lsmith Exp $ require_once 'MDB2/LOB.php'; @@ -166,7 +166,7 @@ * @return object a MDB2 error on failure * @access protected */ - function _baseConvertResult($value, $type, $mode) + function _baseConvertResult($value, $type, $mode = MDB2_PORTABILITY_ALL) { switch ($type) { case 'text': @@ -229,7 +229,8 @@ * * @param mixed $value value to be converted * @param int $type constant that specifies which type to convert to - * @return mixed converted value or a MDB2 error on failure + * @param int $mode bit-wise addition of the required portability modes + * @return mixed converted value * @access public */ function convertResult($value, $type, $mode = MDB2_PORTABILITY_ALL) @@ -259,6 +260,7 @@ * * @param resource $result result identifier * @param array $row array with data + * @param int $mode bit-wise addition of the required portability modes * @return mixed MDB2_OK on success, a MDB2 error on failure * @access public */ http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/fbsql.php?r1=1.30&r2=1.31&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/fbsql.php diff -u pear/MDB2/MDB2/Driver/Datatype/fbsql.php:1.30 pear/MDB2/MDB2/Driver/Datatype/fbsql.php:1.31 --- pear/MDB2/MDB2/Driver/Datatype/fbsql.php:1.30 Sat Jun 17 22:30:05 2006 +++ pear/MDB2/MDB2/Driver/Datatype/fbsql.php Sun Aug 20 08:35:51 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.30 2006/06/17 22:30:05 lsmith Exp $ +// $Id: fbsql.php,v 1.31 2006/08/20 08:35:51 lsmith Exp $ // require_once 'MDB2/Driver/Datatype/Common.php'; @@ -65,10 +65,11 @@ * * @param mixed $value value to be converted * @param int $type constant that specifies which type to convert to + * @param int $mode bit-wise addition of the required portability modes * @return mixed converted value * @access public */ - function convertResult($value, $type) + function convertResult($value, $type, $mode = MDB2_PORTABILITY_ALL) { if (is_null($value)) { return null; @@ -82,10 +83,8 @@ } else { return $value; } - default: - return $this->_baseConvertResult($value, $type); } - return $this->_baseConvertResult($value, $type); + return $this->_baseConvertResult($value, $type, $mode); } // }}} http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/ibase.php?r1=1.80&r2=1.81&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/ibase.php diff -u pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.80 pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.81 --- pear/MDB2/MDB2/Driver/Datatype/ibase.php:1.80 Thu Jul 20 10:24:04 2006 +++ pear/MDB2/MDB2/Driver/Datatype/ibase.php Sun Aug 20 08:35:51 2006 @@ -44,7 +44,7 @@ // | Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.80 2006/07/20 10:24:04 quipo Exp $ +// $Id: ibase.php,v 1.81 2006/08/20 08:35:51 lsmith Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -65,10 +65,11 @@ * * @param mixed $value value to be converted * @param int $type constant that specifies which type to convert to + * @param int $mode bit-wise addition of the required portability modes * @return mixed converted value or a MDB2 error on failure * @access public */ - function convertResult($value, $type) + function convertResult($value, $type, $mode = MDB2_PORTABILITY_ALL) { if (is_null($value)) { return null; @@ -81,9 +82,8 @@ switch ($type) { case 'timestamp': return substr($value, 0, strlen('YYYY-MM-DD HH:MM:SS')); - default: - return $this->_baseConvertResult($value, $type); } + return $this->_baseConvertResult($value, $type, $mode); } // }}} http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/mssql.php?r1=1.42&r2=1.43&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/mssql.php diff -u pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.42 pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.43 --- pear/MDB2/MDB2/Driver/Datatype/mssql.php:1.42 Thu Aug 10 09:53:10 2006 +++ pear/MDB2/MDB2/Driver/Datatype/mssql.php Sun Aug 20 08:35:51 2006 @@ -44,7 +44,7 @@ // | Daniel Convissor <danielc@php.net> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.42 2006/08/10 09:53:10 lsmith Exp $ +// $Id: mssql.php,v 1.43 2006/08/20 08:35:51 lsmith Exp $ // require_once 'MDB2/Driver/Datatype/Common.php'; @@ -65,10 +65,11 @@ * * @param mixed $value value to be converted * @param int $type constant that specifies which type to convert to + * @param int $mode bit-wise addition of the required portability modes * @return mixed converted value * @access public */ - function convertResult($value, $type) + function convertResult($value, $type, $mode = MDB2_PORTABILITY_ALL) { if (is_null($value)) { return null; @@ -86,9 +87,8 @@ $value = substr($value,11,8); } return $value; - default: - return $this->_baseConvertResult($value,$type); } + return $this->_baseConvertResult($value, $type, $mode); } // }}} // {{{ getTypeDeclaration() http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/oci8.php?r1=1.63&r2=1.64&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/oci8.php diff -u pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.63 pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.64 --- pear/MDB2/MDB2/Driver/Datatype/oci8.php:1.63 Fri Jul 21 07:12:31 2006 +++ pear/MDB2/MDB2/Driver/Datatype/oci8.php Sun Aug 20 08:35:51 2006 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.63 2006/07/21 07:12:31 lsmith Exp $ +// $Id: oci8.php,v 1.64 2006/08/20 08:35:51 lsmith Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -62,10 +62,11 @@ * * @param mixed $value value to be converted * @param int $type constant that specifies which type to convert to + * @param int $mode bit-wise addition of the required portability modes * @return mixed converted value * @access public */ - function convertResult($value, $type) + function convertResult($value, $type, $mode = MDB2_PORTABILITY_ALL) { if (is_null($value)) { return null; @@ -75,9 +76,8 @@ return substr($value, 0, strlen('YYYY-MM-DD')); case 'time': return substr($value, strlen('YYYY-MM-DD '), strlen('HH:MI:SS')); - default: - return $this->_baseConvertResult($value, $type); } + return $this->_baseConvertResult($value, $type, $mode); } // }}} http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Datatype/pgsql.php?r1=1.72&r2=1.73&diff_format=u Index: pear/MDB2/MDB2/Driver/Datatype/pgsql.php diff -u pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.72 pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.73 --- pear/MDB2/MDB2/Driver/Datatype/pgsql.php:1.72 Wed Aug 9 21:44:06 2006 +++ pear/MDB2/MDB2/Driver/Datatype/pgsql.php Sun Aug 20 08:35:51 2006 @@ -42,7 +42,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.72 2006/08/09 21:44:06 lsmith Exp $ +// $Id: pgsql.php,v 1.73 2006/08/20 08:35:51 lsmith Exp $ require_once 'MDB2/Driver/Datatype/Common.php'; @@ -62,10 +62,11 @@ * * @param mixed $value value to be converted * @param int $type constant that specifies which type to convert to + * @param int $mode bit-wise addition of the required portability modes * @return mixed converted value or a MDB2 error on failure * @access public */ - function convertResult($value, $type) + function convertResult($value, $type, $mode = MDB2_PORTABILITY_ALL) { if (is_null($value)) { return null; @@ -83,9 +84,9 @@ return substr($value, 0, strlen('YYYY-MM-DD HH:MM:SS')); case 'blob': $value = pg_unescape_bytea($value); - default: - return $this->_baseConvertResult($value, $type); + return $this->_baseConvertResult($value, $type, $mode); } + return $this->_baseConvertResult($value, $type, $mode); } // }}}
« previous php.pear.cvs (#41754) next »