CodeIgniter Forums
Reach Class method locally - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Reach Class method locally (/showthread.php?tid=17377)



Reach Class method locally - El Forum - 04-03-2009

[eluser]asylmottaket[/eluser]
Is that even possible?

It's for use with CRON execution.


Reach Class method locally - El Forum - 04-03-2009

[eluser]TheFuzzy0ne[/eluser]
http://www.larrykagan.com/blog/view/CodeIgniter-from-the-Command-Line. (This page doesn't display correctly in Google's Chrome Web browser.)


Reach Class method locally - El Forum - 04-03-2009

[eluser]asylmottaket[/eluser]
Sweet. Thanks!


Reach Class method locally - El Forum - 04-04-2009

[eluser]asylmottaket[/eluser]
The solution works nice, but I seems to have some issues when the class method uses the email and db class.


mail($recipient, $subject, $mail_body, $header); ..worked fine, but not when using the CI email class.

Database queries didnt fire either.

What am I overlooking?


Reach Class method locally - El Forum - 04-04-2009

[eluser]TheFuzzy0ne[/eluser]
Perhaps they use super globals that are specified only when it's run as a server. I'd suggest doing a:

Code:
echo '<pre>',print_r(),'</pre>';

in each of your apps, and seeing what's missing.


Reach Class method locally - El Forum - 04-04-2009

[eluser]asylmottaket[/eluser]
But isnt it quite strange anyways?

The only thing I need for the email/db-stuff to work, is for the CRON to just visit the spesified URL.

/newsletter/process_queue