summaryrefslogtreecommitdiff
path: root/pear
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2000-08-24 01:34:16 +0000
committerSterling Hughes <sterling@php.net>2000-08-24 01:34:16 +0000
commit4850e34bf3efd5c8d3c773d73c7983922d81a85d (patch)
treec0e22d8cb62513116022c8e70a213358759c7b8a /pear
parent5875af9372dd59e8cfc94be0637cc272072cb495 (diff)
downloadphp-git-4850e34bf3efd5c8d3c773d73c7983922d81a85d.tar.gz
-Add getCode() method to PEAR_Error
-Correct license versions + My Address for DB/* mods -Correct ibase module -Javadocize File_Find -Add a optional constructor to DB that passes it on to DB::connect()
Diffstat (limited to 'pear')
-rw-r--r--pear/DB.php12
-rw-r--r--pear/PEAR.php.in14
2 files changed, 24 insertions, 2 deletions
diff --git a/pear/DB.php b/pear/DB.php
index 2e53f79e6d..d9b809ea69 100644
--- a/pear/DB.php
+++ b/pear/DB.php
@@ -152,6 +152,14 @@ if (!defined('DB_GETMODE_DEFAULT')) {
* @since PHP 4.0
*/
class DB {
+
+ function DB ($dsn = false, $persistent = false)
+ {
+ if ($dsn) {
+ return DB::connect ($dsn, $persistent);
+ }
+ }
+
// {{{ factory()
/**
@@ -162,7 +170,7 @@ class DB {
* @return object a newly created DB object, or a DB error code on
* error
*/
- function &factory($type) {
+ function &factory($type) {
@include_once("DB/${type}.php");
$classname = 'DB_' . $type;
$obj = @new $classname;
@@ -170,7 +178,7 @@ class DB {
return new DB_Error(DB_ERROR_NOT_FOUND);
}
return $obj;
- }
+ }
// }}}
// {{{ connect()
diff --git a/pear/PEAR.php.in b/pear/PEAR.php.in
index b1b4182a90..3575330926 100644
--- a/pear/PEAR.php.in
+++ b/pear/PEAR.php.in
@@ -143,6 +143,7 @@ class PEAR_Error
var $mode = PEAR_ERROR_RETURN;
var $level = E_USER_NOTICE;
+ var $code = -1;
var $message = '';
@@ -206,6 +207,19 @@ class PEAR_Error
// }}}
+ // {{{ getCode()
+
+ /**
+ * Get error code from an error object
+ *
+ * @return int error code
+ */
+ function getCode ()
+ {
+ return ($this->code);
+ }
+
+ // }}}
// {{{ getType()
/**