* Create a new DB connection object for the specified database
* type
*
- * @param string $type database type, for example "mysql"
+ * @param string database type, for example "mysql"
*
* @return mixed a newly created DB object, or a DB error code on
* error
* Create a new DB connection object and connect to the specified
* database
*
- * @param mixed $dsn "data source name", see the DB::parseDSN
+ * @param mixed "data source name", see the DB::parseDSN
* method for a description of the dsn format. Can also be
* specified as an array of the format returned by DB::parseDSN.
*
- * @param mixed $options An associative array of option names and
+ * @param mixed An associative array of option names and
* their values. For backwards compatibility, this parameter may
* also be a boolean that tells whether the connection should be
* persistent. See DB_common::setOption for more information on
/**
* Tell whether a result code from a DB method is an error
*
- * @param $value int result code
+ * @param int result code
*
* @return bool whether $value is an error
*
is_subclass_of($value, 'db_error')));
}
+ /**
+ * Tell whether a value is a DB connection
+ *
+ * @param mixed value to test
+ *
+ * @return bool whether $value is a DB connection
+ *
+ * @access public
+ */
+ function isConnection($value)
+ {
+ return (is_object($value) &&
+ is_subclass_of($value, 'db_common') &&
+ method_exists($value, 'simpleQuery'));
+ }
+
/**
* Tell whether a query is a data manipulation query (insert,
* update or delete) or a data definition query (create, drop,
*
* @access public
*
- * @param string $query the query
+ * @param string the query
*
* @return boolean whether $query is a data manipulation query
*/
* Warnings differ from errors in that they are generated by DB,
* and are not fatal.
*
- * @param mixed $value result value
+ * @param mixed result value
*
* @return boolean whether $value is a warning
*
/**
* Return a textual error message for a DB error code
*
- * @param integer $value error code
+ * @param integer error code
*
* @return string error message, or false if the error code was
* not recognized
* phptype(dbsyntax)
* phptype
*
- * @param string $dsn Data Source Name to be parsed
+ * @param string Data Source Name to be parsed
*
* @return array an associative array
*
*
* @access public
*
- * @param string $name the base name of the extension (without the .so or
- * .dll suffix)
+ * @param string the base name of the extension (without the .so or
+ * .dll suffix)
*
* @return boolean true if the extension was already or successfully
* loaded, false if it could not be loaded
/**
* DB_Error constructor.
*
- * @param mixed $code DB error code, or string with error message.
- * @param integer $mode what "error mode" to operate in
- * @param integer $level what error level to use for $mode & PEAR_ERROR_TRIGGER
- * @param smixed $debuginfo additional debug info, such as the last query
+ * @param mixed DB error code, or string with error message.
+ * @param integer what "error mode" to operate in
+ * @param integer what error level to use for $mode & PEAR_ERROR_TRIGGER
+ * @param mixed additional debug info, such as the last query
*
* @access public
*
/**
* DB_Warning constructor.
*
- * @param mixed $code DB error code, or string with error message.
- * @param integer $mode what "error mode" to operate in
- * @param integer $level what error level to use for $mode == PEAR_ERROR_TRIGGER
- * @param mmixed $debuginfo additional debug info, such as the last query
+ * @param mixed DB error code, or string with error message.
+ * @param integer what "error mode" to operate in
+ * @param integer what error level to use for $mode == PEAR_ERROR_TRIGGER
+ * @param mmixed additional debug info, such as the last query
*
* @access public
*
/**
* DB_result constructor.
- * @param resource $dbh DB object reference
- * @param resource $result result resource id
+ * @param resource DB object reference
+ * @param resource result resource id
*/
function DB_result(&$dbh, $result)
/**
* Fetch and return a row of data (it uses driver->fetchInto for that)
- * @param int $fetchmode format of fetched row
- * @param int $rownum the row number to fetch
+ * @param int format of fetched row
+ * @param int the row number to fetch
*
* @return array a row of data, NULL on no more rows or PEAR_Error on error
*
/**
* Fetch a row of data into an existing variable.
*
- * @param mixed $arr reference to data containing the row
- * @param integer $fetchmode format of fetched row
- * @param integer $rownum the row number to fetch
+ * @param mixed reference to data containing the row
+ * @param integer format of fetched row
+ * @param integer the row number to fetch
*
* @return mixed DB_OK on success, NULL on no more rows or
* a DB_Error object on error