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

Bug #1139 Always Fatal error: Cannot redeclare class mail in ......
Submitted: 2004-04-05 21:21 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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 10 + 1 = ?

 
 [2004-04-05 21: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 21: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 23:37 UTC] chagenbu at php dot net
I agree with Jon.
 [2004-04-06 05: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-11 04:35 UTC] hunny_bunny_s at yahoo dot com (hunny_bunny_s)
HELP GET TO SEND MAIL PLEASE