MDB - Error questions
| From: | Brent Cook | Date: | Thu, 13 Jun 2002 15:57:54 +0000 |
| Subject: | MDB - Error questions | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6986@lists.php.net to get a copy of this message | ||
Hi Lukas,
In MDB.php
function &factory($type)
{
@include_once("${type}.php");
$classname = "DB_${type}";
if (!class_exists($classname)) {
return PEAR::raiseError(NULL, DB_ERROR_NOT_FOUND,
NULL, NULL, NULL, 'DB_Error', TRUE);
}
@$db =& new $classname;
return $db;
}
Should the class indicated in raiseError be MDB_Error?
Also, what's the difference between doing this:
return PEAR::raiseError(NULL, DB_ERROR_INVALID_DSN, NULL, NULL, 'no valid
DBMS driver include path specified', 'MDB_Error', TRUE);
and this:
return PEAR::raiseError('no valid DBMS driver include path specified',
NULL, DB_ERROR_INVALID_DSN, NULL, NULL, 'MDB_Error');
- Brent