Connecting Tech Pros Worldwide Forums | Help | Site Map

Pear: Mail_Queue problem, Cannot redeclare class mail_queue_container:mail_queue_container_db

Ciegalo
Guest
 
Posts: n/a
#1: Apr 6 '07
Hi to all,
I'm getting my hands into PEAR for a small newsletter-sending project.
I need to boost the performance of the sending script and came accross
this mail_queue class that should queue the emails.

After sweating over the pear installation on myWindows Machine (IIS,
PHP 4.4.6, MySQL), I cannot even run the tutorial script.. I get :
Fatal error: Cannot redeclare class
mail_queue_container:mail_queue_container_db in p:\softs\php\pear\Mail
\Queue\Container\db.php on line 44

Any idea ? Nothing in the bugtracker of the package.

Thanks in advance for your help !

BR,
Damien


Mityok
Guest
 
Posts: n/a
#2: Apr 6 '07

re: Pear: Mail_Queue problem, Cannot redeclare class mail_queue_container:mail_queue_container_db


On Apr 6, 11:56 am, "Ciegalo" <damien.poc...@gmail.comwrote:
Quote:
Hi to all,
I'm getting my hands into PEAR for a small newsletter-sending project.
I need to boost the performance of the sending script and came accross
this mail_queue class that should queue the emails.
>
After sweating over the pear installation on myWindows Machine (IIS,
PHP 4.4.6, MySQL), I cannot even run the tutorial script.. I get :
Fatal error: Cannot redeclare class
mail_queue_container:mail_queue_container_db in p:\softs\php\pear\Mail
\Queue\Container\db.php on line 44
>
Any idea ? Nothing in the bugtracker of the package.
>
Thanks in advance for your help !
>
BR,
Damien
Hello Damien,

You should check to use include_once (or require_once), not include
(or require) statements when you are including PEAR Mail functions to
your code.

Best Regards,
Mityok

Ciegalo
Guest
 
Posts: n/a
#3: Apr 6 '07

re: Pear: Mail_Queue problem, Cannot redeclare class mail_queue_container:mail_queue_container_db


On 6 avr, 17:25, "Mityok" <mit...@gmail.comwrote:
Quote:
On Apr 6, 11:56 am, "Ciegalo" <damien.poc...@gmail.comwrote:
>
Quote:
Hi to all,
I'm getting my hands into PEAR for a small newsletter-sending project.
I need to boost the performance of the sending script and came accross
this mail_queue class that should queue the emails.
>
Quote:
After sweating over the pear installation on myWindows Machine (IIS,
PHP 4.4.6, MySQL), I cannot even run the tutorial script.. I get :
Fatal error: Cannot redeclare class
mail_queue_container:mail_queue_container_db in p:\softs\php\pear\Mail
\Queue\Container\db.php on line 44
>
Quote:
Any idea ? Nothing in the bugtracker of the package.
>
Quote:
Thanks in advance for your help !
>
Quote:
BR,
Damien
>
Hello Damien,
>
You should check to use include_once (or require_once), not include
(or require) statements when you are including PEAR Mail functions to
your code.
>
Best Regards,
Mityok
Hello,
Thanks for the pointer, I had not thought about that. Yet, it does not
solve the problem...

Can it be something bad I've done during setup ? An incompatibility
with IIS ? I'm using the code stroight out of the tutorial.

Thanks again !
Damien

Mityok
Guest
 
Posts: n/a
#4: Apr 20 '07

re: Pear: Mail_Queue problem, Cannot redeclare class mail_queue_container:mail_queue_container_db


On Apr 6, 8:43 pm, "Ciegalo" <damien.poc...@gmail.comwrote:
Quote:
On 6 avr, 17:25, "Mityok" <mit...@gmail.comwrote:
>
>
>
Quote:
On Apr 6, 11:56 am, "Ciegalo" <damien.poc...@gmail.comwrote:
>
Quote:
Quote:
Hi to all,
I'm getting my hands into PEAR for a small newsletter-sending project.
I need to boost the performance of the sending script and came accross
this mail_queue class that should queue the emails.
>
Quote:
Quote:
After sweating over the pear installation on myWindows Machine (IIS,
PHP 4.4.6, MySQL), I cannot even run the tutorial script.. I get :
Fatal error: Cannot redeclare class
mail_queue_container:mail_queue_container_db in p:\softs\php\pear\Mail
\Queue\Container\db.php on line 44
>
Quote:
Quote:
Any idea ? Nothing in the bugtracker of the package.
>
Quote:
Quote:
Thanks in advance for your help !
>
Quote:
Quote:
BR,
Damien
>
Quote:
Hello Damien,
>
Quote:
You should check to use include_once (or require_once), not include
(or require) statements when you are including PEAR Mail functions to
your code.
>
Quote:
Best Regards,
Mityok
>
Hello,
Thanks for the pointer, I had not thought about that. Yet, it does not
solve the problem...
>
Can it be something bad I've done during setup ? An incompatibility
with IIS ? I'm using the code stroight out of the tutorial.
>
Thanks again !
Damien
Hello Damie.

No, this issue is not IIS specific.
The difference between include and include_once is that "include"
function will include given source file every time it occurs in your
source code, while "include_once" will include source file only if it
was not included before.

Example :
file : inc.php
<?php
print 'Included string!!!!<br/>';
?>
file inc_test.php
<?php
include 'inc.php';
include 'inc.php';
include 'inc.php';
?>
Output will be:
Included string!!!!<br/>
Included string!!!!<br/>
Included string!!!!<br/>

file inconce_test.php
<?php
include_once 'inc.php';
include_once 'inc.php';
include_once 'inc.php';
?>
Output will be:
Included string!!!!<br/>

BTW, read the manual, it rocks :)

Closed Thread