I am working on football odds website for first time.
I am getting xml data from an online xml feeder, parsing xml data using PHP and send that data to mysql database, from another php file i get that data and print it on html document.
Xml feeder has time limits for each function, for example: time limit for League is 3600s, time limit for Live Fixture is 25s etc..
I send data using just one file called as sendxmldata.php, there is functions like: SendLeaguesToDb(), SendFixturesToDb() etc..
And now i want to run these functions every XX-XXXX seconds, so each function has different time limit.
How i can to run that functions every XX seconds, i need to run it and when users are not on website?
What is the best way to do this?
Using something like Cron Job or how? If is answer yes, use something like Cron, is there way to run an function from file for 25s, and another from same file for 3600s? Or i need for every function or time_limit create new php file to run? There is very much functions.
Thanks.
You can create two cronjobspointing to the same file as @jQuery.PHP.Magento.com pointed out. You can pass an argument to choose witch function to call:
You would then use parse_str() to set and access the paramaters:
to use timeout as an parameter:
and to read it: