I am trying to use the Pear mail_queue library with Yii so I can send notification mails to users after comments have been made on a discussion thread. Without the queue, the save button hangs waiting to send mails.
I have installed Pear Mail_Queue on my server and have confirmed it is working.
I cannot see how to reference it in Yii
I have tried
$queue =& new Mail_Queue($db_options, $mail_options);
but get the error message
<p>include(Mail_Queue_Container_.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory (/var/www/yii-read-only/framework/yiilite.php:217)</p>
<pre>#0 /var/www/yii-read-only/framework/yiilite.php(217): CWebApplication->handleError()
#1 /var/www/yii-read-only/framework/yiilite.php(217): autoload()
Any help to reference this library would be appreciated it
I checked again. The Pear class for Mail_Queue is definitely being loaded on the require_once and is referenced. When I leave out the parameters for this on calling it $temp = Mail_Queue(); I get an error saying parameter is not defined properly and showing me that it is pulling it from /usr/local/lib/php/Mail
When I put the parameters in properly, I get the same error again as above.
Just a note, modifying any of Yii’s framework files is never a good idea unless you’re prepared to maintain what essentially becomes your fork of the Yii framework, just for your application(s). With current versioning systems (hg, git), it’s a simple matter to keep up-to-date nowadays, but that’s still not the best approach.
Whenever you need functionality from Yii that doesn’t already exist, then the solution is to extend the Yii library that is missing that feature. If you find that you must modify Yii’s framework files, then you’re still probably doing it wrong, as again that should never be the solution unless you are prepared to maintain your own fork.