1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00

factory-generated classes have lowercase subclass names by our (newly

revised) standards.
This commit is contained in:
Chuck Hagenbuch
2001-02-22 16:01:14 +00:00
parent 047e598c3a
commit 6bbecd4c07
2 changed files with 3 additions and 9 deletions

View File

@@ -35,15 +35,9 @@ class Mail extends PEAR {
*/
function factory($driver, $params = array())
{
$driver = strtolower($driver);
if (@include_once 'Mail/' . $driver . '.php') {
$class = 'Mail_' . $driver;
} elseif (@include_once 'Mail/' . strtoupper($driver) . '.php') {
$class = 'Mail_' . strtoupper($driver);
} elseif (@include_once 'Mail/' . ucfirst($driver) . '.php') {
$class = 'Mail_' . ucfirst($driver);
}
if (isset($class)) {
return new $class($params);
} else {
return new PEAR_Error('Unable to find class for driver ' . $driver);

View File

@@ -69,8 +69,8 @@ PEAR_FILES = \
Log/syslog.php \
Mail.php \
Mail/RFC822.php \
Mail/Sendmail.php \
Mail/SMTP.php \
Mail/sendmail.php \
Mail/smtp.php \
Math/Fraction.php \
Math/Util.php \
Net/Curl.php \