I have application built in Zend Framework 2. I would like to set cron job for updating my products. I know scripts such as this should be run from outside of public folder, but unfortunately my script in cron needs to use framework files.
How can I do this?
The only way I figured out is to run script from outside of public folder then add some hash or password and redirect to
www.domain.com/cron/test
So I will have all framework functionality.
Will it be secure? Maybe there is a other way?
I found the solution at collabnet (Which is now dead).
I am copying the solution here as ColabEdit sometimes removes posts:
I strongly recommend to use CLI for such requirement.
Add a console route to your application module's
module.config.php
:Now open the terminal and
Thats all. Hope it helps.