Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.0

Bug #1139 Always Fatal error: Cannot redeclare class mail in ......
Submitted: 2004-04-05 16:21 UTC Modified: 2004-04-06 00:10 UTC
From: FractalizeR at yandex dot ru Assigned: jon
Status: Closed Package: Mail
PHP Version: 4.3.3 OS: Windows 2000
Roadmaps: (Not assigned)    
Subscription  


 [2004-04-05 16:21 UTC] FractalizeR at yandex dot ru
Description: ------------ When I try to create mailer instance, I always get error message Fatal error: Cannot redeclare class mail in <...>\PEAR\PEAR\Mail.php on line 33 This is because files Mail.php (base PEAR Mail class) and class mail.php used as engine to PHP mail() function have the same name under Windows. The temporary solution is to remove or comment require_once 'Mail.php'; line from mail.php (mail() engine script) Reproduce code: --------------- $MailingEngine = &Mail::factory('mail'); Expected result: ---------------- Fatal error: Cannot redeclare class mail in <...>\PEAR\PEAR\Mail.php on line 33

Comments

 [2004-04-05 16:39 UTC] jon
It sounds like this is more of a problem with require_once() being unable to distinguish between 'Mail.php' and 'Mail/mail.php', right? I think it would be safe to remove the "require_once 'Mail.php';" lines from all of the Mail/ drivers. Those lines are only there to support the direct instantiation of one of those subclasses (e.g., "new Mail_mail()").
 [2004-04-05 18:37 UTC] chagenbu at php dot net
I agree with Jon.
 [2004-04-06 00:10 UTC] jon
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.
 [2006-10-10 23:35 UTC] hunny_bunny_s at yahoo dot com (hunny_bunny_s)
HELP GET TO SEND MAIL PLEASE