Okay, so we have this site that we took over from a previous firm...PHP, Zend Framework, MySQL etc.
It's an interesting site in that they utilize a CMS that's external (they manage some data like forums, user subscription, etc.)
So there's a library that communicates via web service calls from PHP to the CMS, and then from JavaScript it calls the code which returns JSON data (which is then manipulated into HTML/CSS).
We need a scheduled task that runs daily. Its job is to get users from this CMS, iterate through them and check xxx amount of fields. Based upon the number of fields populated, if 80% or greater is populated, they're eligible to be a featured user.
And, in our database, I have 2 fields (isFeatured and featuredIndex). isFeatured being a flag, featuredIndex since a featured user will either be #1, #2, or #3.
Either way, our dev environment is Windows + PHP5 + Apache (with PHP running as an Apache module, and not CGI).
I'm thinking the easiest approach is to write a PHP page that will be in the web root, which will only have permissions so it can be run as a scheduled task. What do you guys think?
My challenge is I need to test this locally (suggestions?). The staging and production environments are LAMP setups, fwiw. So, I guess my questions are the following:
- Is this a good way of handling this issue? I.e. a scheduled task which utilizes the existing framework (which relies on this 3rd party CMS with web service communications and Zend Framework)
- How do I write this script so it can run both on Windows and Linux (PHP)?
- And how do I schedule this script to run on a daily basis on Windows and Linux (since it's web based).
Thanks all, -Steve