From b4cdd3af848e79a7577d32ac688b981fc5fc8e89 Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Thu, 9 Aug 2001 08:06:52 +0000 Subject: [PATCH] fix multiple factory calls problem with php < 4.0.7 --- pear/Mail.php | 12 ++++++------ 1 file 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); } - } /** -- 2.50.1