[fw-general] Periodic operations through cron with Zend

2008-12-03 Thread Vahe Oughourlian

Greetings,

 On our previous project, we had several operations (processing of a  
job queue, snapshoting, etc) done through a cronjob.  Being that the  
previous codebase was written in straight php, all the includes and  
such for connecting to the database and whatnot had to be done by  
hand, and we had a few problems with certain assumptions (for  
instance, the inclusion of certain constants) that we had to resolve.


 I'd like to replicate that functionality with Zend, but I'm not  
exactly sure how to go about it.  I'd like that all the inits done in  
the bootstrap be available to this script, but I don't want this  
operation to be a publicly accessible action through a Controller  
action.  Any recommendations?


Thanks,
jedcred


Re: [fw-general] Periodic operations through cron with Zend

2008-12-03 Thread Karol Grecki

Vahe

You don't need anything special to do it with Zend.
Just include your bootstrap in a script file and write any code you need.
If your boostrap contains some MVC specific code you may want to extract it
into another file or create a separate bootstrap for scripts etc.
I personally use an application class where mvc components are set up in
their own method separate from config, etc. so I can reuse it in cron
scripts by just calling the stuff I need. 

Karol


Vahe Oughourlian wrote:
 
 Greetings,
 
   On our previous project, we had several operations (processing of a  
 job queue, snapshoting, etc) done through a cronjob.  Being that the  
 previous codebase was written in straight php, all the includes and  
 such for connecting to the database and whatnot had to be done by  
 hand, and we had a few problems with certain assumptions (for  
 instance, the inclusion of certain constants) that we had to resolve.
 
   I'd like to replicate that functionality with Zend, but I'm not  
 exactly sure how to go about it.  I'd like that all the inits done in  
 the bootstrap be available to this script, but I don't want this  
 operation to be a publicly accessible action through a Controller  
 action.  Any recommendations?
 
 Thanks,
 jedcred
 
 

-- 
View this message in context: 
http://www.nabble.com/Periodic-operations-through-cron-with-Zend-tp20822956p20824282.html
Sent from the Zend Framework mailing list archive at Nabble.com.