cvs: pear /DB_DataObject DataObject.php
| From: | Alan Knowles | Date: | Mon, 25 Jul 2005 05:22:27 +0000 |
| Subject: | cvs: pear /DB_DataObject DataObject.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33284@lists.php.net to get a copy of this message | ||
alan_k Mon Jul 25 01:22:27 2005 EDT
Modified files:
/pear/DB_DataObject DataObject.php
Log:
fix bug #4900 - support array type dsns
http://cvs.php.net/diff.php/pear/DB_DataObject/DataObject.php?r1=1.365&r2=1.366&ty=u
Index: pear/DB_DataObject/DataObject.php
diff -u pear/DB_DataObject/DataObject.php:1.365 pear/DB_DataObject/DataObject.php:1.366
--- pear/DB_DataObject/DataObject.php:1.365 Fri Jul 22 22:42:46 2005
+++ pear/DB_DataObject/DataObject.php Mon Jul 25 01:22:25 2005
@@ -15,7 +15,7 @@
* @author Alan Knowles <alan@akbkhome.com>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: DataObject.php,v 1.365 2005/07/23 02:42:46 alan_k Exp $
+ * @version CVS: $Id: DataObject.php,v 1.366 2005/07/25 05:22:25 alan_k Exp $
* @link http://pear.php.net/package/DB_DataObject
*/
@@ -2077,7 +2077,7 @@
$options= &$_DB_DATAOBJECT['CONFIG'];
$dsn = isset($this->_database_dsn) ? $this->_database_dsn : null;
-
+
if (!$dsn) {
if (!$this->_database) {
$this->_database = isset($options["table_{$this->__table}"]) ?
$options["table_{$this->__table}"] : null;
@@ -2099,8 +2099,12 @@
}
-
- $this->_database_dsn_md5 = md5($dsn);
+ if (is_string($dsn)) {
+ $this->_database_dsn_md5 = md5($dsn);
+ } else {
+ /// support array based dsn's
+ $this->_database_dsn_md5 = md5(serialize($dsn));
+ }
if (!empty($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
@@ -2119,7 +2123,7 @@
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$this->debug("NEW CONNECTION", "CONNECT",3);
/* actualy make a connection */
- $this->debug("{$dsn} {$this->_database_dsn_md5}",
"CONNECT",3);
+ $this->debug(print_r($dsn,true) ." {$this->_database_dsn_md5}",
"CONNECT",3);
}
// Note this is verbose deliberatly!