cvs: pear /MDB common.php
| From: | Lukas Smith | Date: | Fri, 19 Jul 2002 14:50:51 +0000 |
| Subject: | cvs: pear /MDB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5196@lists.php.net to get a copy of this message | ||
lsmith Fri Jul 19 10:50:51 2002 EDT
Modified files:
/pear/MDB common.php
Log:
$dsninfo and $options are now passed to the constructor in MDB_common
this ensures that the driver contstructor can use that data
this fixes issues in the pgsql driver constructor and not being able to run _doConnect()
Index: pear/MDB/common.php
diff -u pear/MDB/common.php:1.30 pear/MDB/common.php:1.31
--- pear/MDB/common.php:1.30 Thu Jul 18 16:00:54 2002
+++ pear/MDB/common.php Fri Jul 19 10:50:51 2002
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@dybnet.de> |
// +----------------------------------------------------------------------+
//
-// $Id: common.php,v 1.30 2002/07/18 20:00:54 lsmith Exp $
+// $Id: common.php,v 1.31 2002/07/19 14:50:51 lsmith Exp $
//
// Base class for DB implementations.
//
@@ -222,12 +222,40 @@
/**
* Constructor
*/
- function MDB_common()
+ function MDB_common($dsninfo, $options)
{
$this->PEAR('MDB_Error');
$this->supported = array();
$this->errorcode_map = array();
$this->fetchmode = DB_FETCHMODE_ORDERED;
+
+ $this->include_path = $include_path;
+ if (isset($dsninfo["hostspec"])) {
+ $this->host = $dsninfo["hostspec"];
+ }
+ if (isset($dsninfo["username"])) {
+ $this->user = $dsninfo["username"];
+ }
+ if (isset($dsninfo["password"])) {
+ $this->password = $dsninfo["password"];
+ }
+ if (isset($options['includelob'])) {
+ $this->loadLob('load at start');
+ }
+ if (isset($options['includemanager'])) {
+ $this->loadManager('load at start');
+ }
+ if (is_array($options)) {
+ $this->options = array_merge($this->options, $options);
+ }
+ if(isset($dsninfo["database"])) {
+ $this->setDatabase($dsninfo["database"]);
+ $err = $this->connect();
+ if (MDB::isError($err)) {
+ $err->addUserInfo($dsn);
+ return $err;
+ }
+ }
}
// }}}