Skip to content

Commit

Permalink
added a contructor in order to be able connect at object creation
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/MDB/trunk@93949 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Lukas Smith committed Aug 28, 2002
1 parent 2488541 commit 18bf635
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
28 changes: 27 additions & 1 deletion MDB/Manager.php
Expand Up @@ -93,6 +93,32 @@ class MDB_manager extends PEAR
)
);

// }}}
// {{{ connect()

/**
* Constructor
*
* @param mixed $dsninfo 'data source name', see the MDB::parseDSN
* method for a description of the dsn format.
* Can also be specified as an array of the
* format returned by MDB::parseDSN.
* Finally you can also pass an existing db
* object to be used.
* @param mixed $options An associative array of option names and
* their values.
* @return mixed DB_OK on success, or a MDB error object
* @access public
* @see MDB::parseDSN
*/
function MDB_manager(&$dsninfo = FALSE, $options = FALSE)
{
if($dsninfo) {
return $this->connect($dsninfo, $options);
}
return (DB_OK);
}

// }}}
// {{{ raiseError()

Expand Down Expand Up @@ -242,7 +268,7 @@ function getOption($option)
* object to be used.
* @param mixed $options An associative array of option names and
* their values.
* @return mixed DB_OK on success, or a MDB error object
* @return mixed DB_OK on success, or a MDB error object
* @access public
* @see MDB::parseDSN
*/
Expand Down
28 changes: 27 additions & 1 deletion MDB/Modules/Manager.php
Expand Up @@ -93,6 +93,32 @@ class MDB_manager extends PEAR
)
);

// }}}
// {{{ connect()

/**
* Constructor
*
* @param mixed $dsninfo 'data source name', see the MDB::parseDSN
* method for a description of the dsn format.
* Can also be specified as an array of the
* format returned by MDB::parseDSN.
* Finally you can also pass an existing db
* object to be used.
* @param mixed $options An associative array of option names and
* their values.
* @return mixed DB_OK on success, or a MDB error object
* @access public
* @see MDB::parseDSN
*/
function MDB_manager(&$dsninfo = FALSE, $options = FALSE)
{
if($dsninfo) {
return $this->connect($dsninfo, $options);
}
return (DB_OK);
}

// }}}
// {{{ raiseError()

Expand Down Expand Up @@ -242,7 +268,7 @@ function getOption($option)
* object to be used.
* @param mixed $options An associative array of option names and
* their values.
* @return mixed DB_OK on success, or a MDB error object
* @return mixed DB_OK on success, or a MDB error object
* @access public
* @see MDB::parseDSN
*/
Expand Down
28 changes: 27 additions & 1 deletion manager.php
Expand Up @@ -93,6 +93,32 @@ class MDB_manager extends PEAR
)
);

// }}}
// {{{ connect()

/**
* Constructor
*
* @param mixed $dsninfo 'data source name', see the MDB::parseDSN
* method for a description of the dsn format.
* Can also be specified as an array of the
* format returned by MDB::parseDSN.
* Finally you can also pass an existing db
* object to be used.
* @param mixed $options An associative array of option names and
* their values.
* @return mixed DB_OK on success, or a MDB error object
* @access public
* @see MDB::parseDSN
*/
function MDB_manager(&$dsninfo = FALSE, $options = FALSE)
{
if($dsninfo) {
return $this->connect($dsninfo, $options);
}
return (DB_OK);
}

// }}}
// {{{ raiseError()

Expand Down Expand Up @@ -242,7 +268,7 @@ function getOption($option)
* object to be used.
* @param mixed $options An associative array of option names and
* their values.
* @return mixed DB_OK on success, or a MDB error object
* @return mixed DB_OK on success, or a MDB error object
* @access public
* @see MDB::parseDSN
*/
Expand Down

0 comments on commit 18bf635

Please sign in to comment.