diff options
author | Tomas V.V.Cox <cox@php.net> | 2001-08-09 08:06:52 +0000 |
---|---|---|
committer | Tomas V.V.Cox <cox@php.net> | 2001-08-09 08:06:52 +0000 |
commit | b4cdd3af848e79a7577d32ac688b981fc5fc8e89 (patch) | |
tree | 0ba50c1855cbeddb898af44e965ff58373a077e5 | |
parent | d87bae9f1b3b9505a12f980bbb05dd097961130e (diff) | |
download | php-git-b4cdd3af848e79a7577d32ac688b981fc5fc8e89.tar.gz |
fix multiple factory calls problem with php < 4.0.7
-rw-r--r-- | pear/Mail.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pear/Mail.php b/pear/Mail.php index 38f955373b..d72f25b3d4 100644 --- a/pear/Mail.php +++ b/pear/Mail.php @@ -29,8 +29,8 @@ require_once 'PEAR.php'; * @version $Revision$ * @package Mail */ -class Mail extends PEAR { - +class Mail extends PEAR +{ /** * Provides an interface for generating Mail:: objects of various * types @@ -43,13 +43,13 @@ class Mail extends PEAR { function factory($driver, $params = array()) { $driver = strtolower($driver); - if (@include_once 'Mail/' . $driver . '.php') { - $class = 'Mail_' . $driver; + @include_once 'Mail/' . $driver . '.php'; + $class = 'Mail_' . $driver; + if (class_exists($class)) { return new $class($params); } else { - return new PEAR_Error('Unable to find class for driver ' . $driver); + return $this->raiseError('Unable to find class for driver ' . $driver); } - } /** |