Hello Everyone!
I have to ask about how do I approach this problem. The scenario is explained below.
We are a QA organization and need to deploy many versions of an application. There are some helper scripts which gather information about the app (version, components, host name, etc) and hit a PHP get URL. This PHP code saves the information inside an XML file.
While apps regularly get recorded into this XML, there is no mechanism to un-register (the app is deployed on Unixes too, so there is no uninstall code as such, it is simply required to delete the app folders). I would estimate that an app deployed is deleted after around 1 month.
I am unable to decide when do I check for older entries in the XML.
- Should I record the date when the entry is made in the XML file and on each execution of the PHP to record a new app, parse the XML to find existing dates and remove those recorded prior to 1 month ?
- Another line of thought was to try and connect to the app via http (within the PHP code) if it was over a 1 month old. If the app was available, retain else delete. But doing so for each execution (when another record request comes to the PHP) would be time consuming. Is there something like starting a new thread ? (I am a newbie to PHP)
- My XML is stored on a Unix system (Solaris 10 to be precise). I was also thinking about a daily 1 time cron task.
Can someone please suggest what approach do I follow ? And if new threads / processes could be spawned from PHP ?
Thanks in advance,
Parag Doke