cvs: pear /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php oci8.php pgsql.php querysim.php sqlite.php
| From: | Lukas Smith | Date: | Fri, 23 Apr 2004 17:06:47 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php oci8.php pgsql.php querysim.php sqlite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-18644@lists.php.net to get a copy of this message | ||
lsmith Fri Apr 23 13:06:47 2004 EDT
Modified files:
/pear/MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php
oci8.php pgsql.php querysim.php sqlite.php
Log:
- added 'result_wrap_class' option and optional parameter to query() to enable
wrapping of result classes into an arbitrary class
- added $result_class param to all drivers where it was missing from the
query() and _executePrepared() methods
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.9&r2=1.10&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.9 pear/MDB2/MDB2/Driver/fbsql.php:1.10 --- pear/MDB2/MDB2/Driver/fbsql.php:1.9 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/fbsql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.9 2004/04/10 10:46:53 lsmith Exp $ +// $Id: fbsql.php,v 1.10 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -350,11 +350,12 @@ * @param mixed $types string or array that contains the types of the * columns in the result set * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -403,6 +404,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.22&r2=1.23&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.22 pear/MDB2/MDB2/Driver/ibase.php:1.23 --- pear/MDB2/MDB2/Driver/ibase.php:1.22 Thu Apr 15 06:34:16 2004 +++ pear/MDB2/MDB2/Driver/ibase.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.22 2004/04/15 10:34:16 quipo Exp $ +// $Id: ibase.php,v 1.23 2004/04/23 17:06:46 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -421,7 +421,7 @@ * @return mixed result identifier if query executed, else MDB2_error * @access private **/ - function _doQuery($query, $prepared_query = 0) + function _doQuery($query, $prepared_query = false) { $connection = ($this->auto_commit ? $this->connection : $this->transaction_id); if ($prepared_query @@ -460,10 +460,14 @@ * the function prepare() * @param string $query query to be executed * @param array $types array that contains the types of the columns in the result set + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure + * * @access private */ - function &_executePrepared($prepared_query, $query, $types = null, $result_class = false) + function &_executePrepared($prepared_query, $query, $types = null, + $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -495,6 +499,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } @@ -509,14 +519,15 @@ * * @param string $query the SQL query * @param array $types array that contains the types of the columns in the result set - * + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { - $result =& $this->_executePrepared(0, $query, $types); + $result =& $this->_executePrepared(false, $query, $types, $result_class, $result_wrap_class); return $result; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.10&r2=1.11&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.10 pear/MDB2/MDB2/Driver/mssql.php:1.11 --- pear/MDB2/MDB2/Driver/mssql.php:1.10 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/mssql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.10 2004/04/10 10:46:53 lsmith Exp $ +// $Id: mssql.php,v 1.11 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -379,12 +379,13 @@ * @param string $query the SQL query * @param mixed $types array that contains the types of the columns in * the result set - * + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function query($query, $types = null) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -428,6 +429,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.11&r2=1.12&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.11 pear/MDB2/MDB2/Driver/mysql.php:1.12 --- pear/MDB2/MDB2/Driver/mysql.php:1.11 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/mysql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.11 2004/04/10 10:46:53 lsmith Exp $ +// $Id: mysql.php,v 1.12 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -432,11 +432,12 @@ * @param mixed $types string or array that contains the types of the * columns in the result set * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -460,10 +461,6 @@ return $connected; } - if (MDB2::isError($connected)) { - return $connected; - } - if ($this->database_name && $this->database_name != $this->connected_database_name ) { @@ -493,6 +490,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } @@ -542,9 +545,8 @@ return 'NULL'; } if ($type) { - for ($i = 0, $j = count($col); $i < $j; ++$i) { - $col[$i] = $this->quote($col[$i], $type); - } + $this->loadModule('datatype'); + return $this->datatype->implodeArray($col, $type); } return implode(', ', $col); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.10&r2=1.11&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.10 pear/MDB2/MDB2/Driver/oci8.php:1.11 --- pear/MDB2/MDB2/Driver/oci8.php:1.10 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/oci8.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.10 2004/04/10 10:46:53 lsmith Exp $ +// $Id: oci8.php,v 1.11 2004/04/23 17:06:46 lsmith Exp $ /** * MDB2 OCI8 driver @@ -573,11 +573,14 @@ * @param string $query query to be executed * @param array $types array that contains the types of the columns in the result set * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure + * * @access private */ - function &_executePrepared($prepared_query, $query, $types = null, $result_class = false) - { + function &_executePrepared($prepared_query, $query, $types = null, + $result_class = false, $result_wrap_class = false) + { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; $limit = $this->row_limit; @@ -609,6 +612,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } @@ -624,13 +633,14 @@ * @param string $query the SQL query * @param array $types array that contains the types of the columns in the result set * @param mixed $result_class string which specifies which result class to use - * + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure + * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { - $result =& $this->_executePrepared(0, $query, $types, $result_class); + $result =& $this->_executePrepared(false, $query, $types, $result_class, $result_wrap_class); return $result; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.12&r2=1.13&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.12 pear/MDB2/MDB2/Driver/pgsql.php:1.13 --- pear/MDB2/MDB2/Driver/pgsql.php:1.12 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/pgsql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.12 2004/04/10 10:46:53 lsmith Exp $ +// $Id: pgsql.php,v 1.13 2004/04/23 17:06:46 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -427,12 +427,13 @@ * @param string $query the SQL query * @param array $types array that contains the types of the columns in * the result set - * + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -497,6 +498,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } else { $this->affected_rows = 0; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.8&r2=1.9&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.8 pear/MDB2/MDB2/Driver/querysim.php:1.9 --- pear/MDB2/MDB2/Driver/querysim.php:1.8 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/querysim.php Fri Apr 23 13:06:46 2004 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.8 2004/04/10 10:46:53 lsmith Exp $ +// $Id: querysim.php,v 1.9 2004/04/23 17:06:46 lsmith Exp $ // /* @@ -336,6 +336,7 @@ * the result set * * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * * @return mixed Simulated result set as a multidimentional * array if valid QuerySim text was passed in. A MDB2 error @@ -343,7 +344,7 @@ * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = false; $offset = $this->row_offset; @@ -378,6 +379,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } $error =& $this->raiseError(); http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.13&r2=1.14&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.13 pear/MDB2/MDB2/Driver/sqlite.php:1.14 --- pear/MDB2/MDB2/Driver/sqlite.php:1.13 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/sqlite.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.13 2004/04/10 10:46:53 lsmith Exp $ +// $Id: sqlite.php,v 1.14 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -410,12 +410,12 @@ * @param mixed $types string or array that contains the types of the * columns in the result set * @param mixed $result_class string which specifies which result class to use - * + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -462,6 +462,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } }
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.9&r2=1.10&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.9 pear/MDB2/MDB2/Driver/fbsql.php:1.10 --- pear/MDB2/MDB2/Driver/fbsql.php:1.9 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/fbsql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.9 2004/04/10 10:46:53 lsmith Exp $ +// $Id: fbsql.php,v 1.10 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -350,11 +350,12 @@ * @param mixed $types string or array that contains the types of the * columns in the result set * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -403,6 +404,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.22&r2=1.23&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.22 pear/MDB2/MDB2/Driver/ibase.php:1.23 --- pear/MDB2/MDB2/Driver/ibase.php:1.22 Thu Apr 15 06:34:16 2004 +++ pear/MDB2/MDB2/Driver/ibase.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.22 2004/04/15 10:34:16 quipo Exp $ +// $Id: ibase.php,v 1.23 2004/04/23 17:06:46 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -421,7 +421,7 @@ * @return mixed result identifier if query executed, else MDB2_error * @access private **/ - function _doQuery($query, $prepared_query = 0) + function _doQuery($query, $prepared_query = false) { $connection = ($this->auto_commit ? $this->connection : $this->transaction_id); if ($prepared_query @@ -460,10 +460,14 @@ * the function prepare() * @param string $query query to be executed * @param array $types array that contains the types of the columns in the result set + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure + * * @access private */ - function &_executePrepared($prepared_query, $query, $types = null, $result_class = false) + function &_executePrepared($prepared_query, $query, $types = null, + $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -495,6 +499,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } @@ -509,14 +519,15 @@ * * @param string $query the SQL query * @param array $types array that contains the types of the columns in the result set - * + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { - $result =& $this->_executePrepared(0, $query, $types); + $result =& $this->_executePrepared(false, $query, $types, $result_class, $result_wrap_class); return $result; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.10&r2=1.11&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.10 pear/MDB2/MDB2/Driver/mssql.php:1.11 --- pear/MDB2/MDB2/Driver/mssql.php:1.10 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/mssql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.10 2004/04/10 10:46:53 lsmith Exp $ +// $Id: mssql.php,v 1.11 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -379,12 +379,13 @@ * @param string $query the SQL query * @param mixed $types array that contains the types of the columns in * the result set - * + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function query($query, $types = null) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -428,6 +429,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.11&r2=1.12&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.11 pear/MDB2/MDB2/Driver/mysql.php:1.12 --- pear/MDB2/MDB2/Driver/mysql.php:1.11 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/mysql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.11 2004/04/10 10:46:53 lsmith Exp $ +// $Id: mysql.php,v 1.12 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -432,11 +432,12 @@ * @param mixed $types string or array that contains the types of the * columns in the result set * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -460,10 +461,6 @@ return $connected; } - if (MDB2::isError($connected)) { - return $connected; - } - if ($this->database_name && $this->database_name != $this->connected_database_name ) { @@ -493,6 +490,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } @@ -542,9 +545,8 @@ return 'NULL'; } if ($type) { - for ($i = 0, $j = count($col); $i < $j; ++$i) { - $col[$i] = $this->quote($col[$i], $type); - } + $this->loadModule('datatype'); + return $this->datatype->implodeArray($col, $type); } return implode(', ', $col); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.10&r2=1.11&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.10 pear/MDB2/MDB2/Driver/oci8.php:1.11 --- pear/MDB2/MDB2/Driver/oci8.php:1.10 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/oci8.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.10 2004/04/10 10:46:53 lsmith Exp $ +// $Id: oci8.php,v 1.11 2004/04/23 17:06:46 lsmith Exp $ /** * MDB2 OCI8 driver @@ -573,11 +573,14 @@ * @param string $query query to be executed * @param array $types array that contains the types of the columns in the result set * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure + * * @access private */ - function &_executePrepared($prepared_query, $query, $types = null, $result_class = false) - { + function &_executePrepared($prepared_query, $query, $types = null, + $result_class = false, $result_wrap_class = false) + { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; $limit = $this->row_limit; @@ -609,6 +612,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } } @@ -624,13 +633,14 @@ * @param string $query the SQL query * @param array $types array that contains the types of the columns in the result set * @param mixed $result_class string which specifies which result class to use - * + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure + * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { - $result =& $this->_executePrepared(0, $query, $types, $result_class); + $result =& $this->_executePrepared(false, $query, $types, $result_class, $result_wrap_class); return $result; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.12&r2=1.13&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.12 pear/MDB2/MDB2/Driver/pgsql.php:1.13 --- pear/MDB2/MDB2/Driver/pgsql.php:1.12 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/pgsql.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.12 2004/04/10 10:46:53 lsmith Exp $ +// $Id: pgsql.php,v 1.13 2004/04/23 17:06:46 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -427,12 +427,13 @@ * @param string $query the SQL query * @param array $types array that contains the types of the columns in * the result set - * + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -497,6 +498,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } else { $this->affected_rows = 0; http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.8&r2=1.9&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.8 pear/MDB2/MDB2/Driver/querysim.php:1.9 --- pear/MDB2/MDB2/Driver/querysim.php:1.8 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/querysim.php Fri Apr 23 13:06:46 2004 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.8 2004/04/10 10:46:53 lsmith Exp $ +// $Id: querysim.php,v 1.9 2004/04/23 17:06:46 lsmith Exp $ // /* @@ -336,6 +336,7 @@ * the result set * * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in * * @return mixed Simulated result set as a multidimentional * array if valid QuerySim text was passed in. A MDB2 error @@ -343,7 +344,7 @@ * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = false; $offset = $this->row_offset; @@ -378,6 +379,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } $error =& $this->raiseError(); http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.13&r2=1.14&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.13 pear/MDB2/MDB2/Driver/sqlite.php:1.14 --- pear/MDB2/MDB2/Driver/sqlite.php:1.13 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/sqlite.php Fri Apr 23 13:06:46 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.13 2004/04/10 10:46:53 lsmith Exp $ +// $Id: sqlite.php,v 1.14 2004/04/23 17:06:46 lsmith Exp $ // /** @@ -410,12 +410,12 @@ * @param mixed $types string or array that contains the types of the * columns in the result set * @param mixed $result_class string which specifies which result class to use - * + * @param mixed $result_wrap_class string which specifies which class to wrap results in * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure * * @access public */ - function &query($query, $types = null, $result_class = false) + function &query($query, $types = null, $result_class = false, $result_wrap_class = false) { $ismanip = MDB2::isManip($query); $offset = $this->row_offset; @@ -462,6 +462,12 @@ return $err; } } + if (!$result_wrap_class) { + $result_wrap_class = $this->options['result_wrap_class']; + } + if ($result_wrap_class) { + $result =& new $result_wrap_class($result); + } return $result; } }