cvs: php4 /pear Mail.php

From: Date: Thu, 09 Aug 2001 08:06:52 +0000
Subject: cvs: php4 /pear Mail.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-444@lists.php.net to get a copy of this message
cox Thu Aug 9 04:06:52 2001 EDT Modified files: /php4/pear Mail.php Log: fix multiple factory calls problem with php < 4.0.7 Index: php4/pear/Mail.php diff -u php4/pear/Mail.php:1.13 php4/pear/Mail.php:1.14 --- php4/pear/Mail.php:1.13 Thu Aug 9 03:56:33 2001 +++ php4/pear/Mail.php Thu Aug 9 04:06:52 2001 @@ -16,7 +16,7 @@ // | Authors: Chuck Hagenbuch <chuck@horde.org> | // +----------------------------------------------------------------------+ // -// $Id: Mail.php,v 1.13 2001/08/09 07:56:33 cox Exp $ +// $Id: Mail.php,v 1.14 2001/08/09 08:06:52 cox Exp $ require_once 'PEAR.php'; @@ -26,11 +26,11 @@ * useful in multiple mailer backends. * * @access public - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ * @package Mail */ -class Mail extends PEAR { - +class Mail extends PEAR +{ /** * Provides an interface for generating Mail:: objects of various * types @@ -43,13 +43,13 @@ 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); } - } /**

« previous php.pear.cvs (#444) next »