|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|