Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-04-2008, 09:28 PM
Junior Member
 
Join Date: Jun 2008
Posts: 1
Question Cron/Console Access to ZF Classes

As a part of a ZF project I'm working on, I need to be able to fire off a cron to do Task X. It would be easiest to do Task X with access to models/classes and the ZF framework.

The primary restriction here is that the php controlling the app should not be accessible from the web. A user shouldn't be able to fire off the cron job by navigating to a certain URL.

I've come up with a few less-than-ideal solutions, but it seemed like this should have an easier solution.

The least elegant would be to create a standard controller/view to handle the cron job and secure it in such a way that only the cron will be able to actually fire the right method. Everyone else would get an error. I will do this if I must, but I'd rather find a different way.

Another way would obviously be to hand-include all of the classes needed by the cron app. My fear is that I would spend an inordinate amount of time tracking all of the dependencies down. (Could I just include the autoloader and move on from there?)

It seems to me that there should be a way to write a new bootstrapper, hide it away outside the web root, and call it from the cron job. How would this work? I obviously wouldn't need a front controller, because simply calling that bootstrapper implies one controller/action combo... maybe I can specify all that somehow?

There might also be easier/more obvious ways of doing this that I'm not thinking of.

Any assistance would be greatly appreciated.

/pete
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:25 PM.