lkop Posted August 14, 2013 Share Posted August 14, 2013 I am developing a Prestashop backend module without any hooks. I want to call a method included in module on fixed interval (interval can be set in module configuration) to update some database values. Is this possible in Prestashop? If yes, then how? Link to comment Share on other sites More sharing options...
Nils-H Posted August 14, 2013 Share Posted August 14, 2013 The first thing that comes to mind is to use cron for this. You can have it configured in your module, and then update the crontab when you save the configuration. Link to comment Share on other sites More sharing options...
vekia Posted August 14, 2013 Share Posted August 14, 2013 i've got the same thing in my head. you can create separate .php file where you will have the script to update the database. Then use cron job to execute this script Link to comment Share on other sites More sharing options...
lkop Posted August 14, 2013 Author Share Posted August 14, 2013 (edited) So, cron job is the only way I think it is possible. So will there be any problem regarding to permission to edit or execute commands using cron job? What linux user's cron job file should I use for this? It is a standalone module which will be distributed to my different clients, so I don't have any control over deployed machine's environment. Also crontab for prestashop module is not a solution for me as I am developing a standalone module without any third party module dependency. Edited August 14, 2013 by lkop (see edit history) Link to comment Share on other sites More sharing options...
Nils-H Posted August 14, 2013 Share Posted August 14, 2013 You wouldn't need a thirdparty module to achieve this. There might be a php library for it, but it shouldn't be too hard writing it from scratch either. You should probably run the job with the same user as prestashop is running under apache, since your module would need access to the user's crontab. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now