Hi Guys, Would anyone be willing to send me their batch file for sending emails from a mail queue stored in a database?
TIA, Tom Tom Haskins-Vaughan wrote: > So, I think I've got it going ok, but I'm getting the following notices > for each time I loop thought my mail action: > > PHP Notice: Undefined index: REQUEST_URI in > /usr/share/pear/symfony/request/sfWebRequest.class.php on line 382 > PHP Notice: Undefined index: REQUEST_URI in > /usr/share/pear/symfony/request/sfWebRequest.class.php on line 394 > PHP Notice: Undefined index: SERVER_PORT in > /usr/share/pear/symfony/request/sfWebRequest.class.php on line 416 > PHP Notice: Undefined index: SERVER_PORT in > /usr/share/pear/symfony/request/sfWebRequest.class.php on line 416 > > The mails seem to be being sent (or at least they appear in my log), my > question is, do these notices matter? > > Also, I had to change the module.yml config file to is_internal: off > otherwise I get the following error: > > PHP Fatal error: Uncaught exception 'sfConfigurationException' with > message 'Action "processQueuedMailshotEmail" from module "mail" cannot > be called directly' in > /usr/share/pear/symfony/controller/sfController.class.php:237 > > Any thoughts? > > TIA > > Piers Warmers wrote: >>> But surely a batch script shouldn't >> >> Well, the batch script can definitely be accessing code which accesses >> session logic. >> >> I see your point though... reading the original message more >> carefully :) >> >>>>> sfContext::getInstance()->getLogger()->info('Number of emails >>>>> ='.count($queuedMailshotEmails)); >> It doesn't seem likely the that line in particular is interacting with >> session logic. >> >> But the warning is definitely complaining of a session interaction. >> >> That's were I'd start the search :) >> >> >> >> >> On 24/04/2008, at 10:04 PM, Tom Haskins-Vaughan wrote: >> >>> Thanks, Piers. But surely a batch script shouldn't have access to the >>> session? >>> >>> Piers Warmers wrote: >>>> Hi Tom, >>>> >>>> I think you will find that the issue is php from the cli won't have >>>> any session abilities... thus the warnings. >>>> >>>> One solution, if the warning are driving you nuts, is to suppress >>>> them >>>> for selected method calls - eg: >>>> >>>> @sfContext::getInstance()->getLogger........... >>>> >>>> That will suppress warning stemming from that line. >>>> >>>> That should do the trick. >>>> >>>> - Piers >>>> >>>> >>>> On 24/04/2008, at 11:28 AM, Tom Haskins-Vaughan wrote: >>>> >>>>> Hi I am having trouble writing a batch script to send emails from a >>>>> database email queue. While I'm developing I'd like to add >>>>> messages to >>>>> the log. So I out the following line in my batch file: >>>>> >>>>> sfContext::getInstance()->getLogger()->info('Number of emails >>>>> ='.count($queuedMailshotEmails)); >>>>> >>>>> But when I run the file with that line in PHP throws a fit: >>>>> >>>>> [EMAIL PROTECTED] batch]$ php email_batch_dev.php >>>>> PHP Warning: session_start(): >>>>> open(/var/lib/php/session/sess_levn1rkjl1t2vcd9t849pj7lo1, O_RDWR) >>>>> failed: Permission denied (13) in >>>>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line >>>>> 77 >>>>> >>>>> >>>>> There are 6 warnings in total. >>>>> >>>>> I'm sure I'm just being really stupid, but if someone could >>>>> confirm my >>>>> stupidity and offer a solution that would be great :D >>>>> >>>>> TIA >>>>> >>>>> Tom >>>>> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---