views:

108

answers:

2

I am working on a custom PHP/MySQL CMS. The data managed in the CMS is exported to XML files via a PHP script that must be ran manually. A Flash/AS3-based front-end loads the XML files and displays the specified data.

Is it advisable to setup some sort of automated process for creating the XML files?

What are some "best-practices" or related advice?

Thanks!

+2  A: 

If you have os access, then of course you can create these files via CRON for unix or linux or Scheduler on Windows. If the process only actually needs to regenerate files when things have changed, your data change process can additionally put the "refresh" request into a Queue (either a flat file or database table) that is then picked up by the script that generates the XML files to know which should be rerun. If all of the files should just be generated on a periodic basis, then code the script to process all and set that to run from whatever scheduler you are using.

If you don't have OS access, you can code it in a php page that requires credentials and setup a scheduler with a script on your desktop to just call out to the page to tell it when to refresh when given the proper credentials.

REW
Why not just update the relevant XML files whenever data is changed. It can't be such a costly operation that it requires a queue.
Bart van Heukelom
+1  A: 

I suggest:

  1. Set Flash script to read XML file from /location/file.php
  2. This file.php can generate XML and output it to Flash
  3. You can make cashing mechanism on that file.php
Liutas
Oh! That seems perfect. I'll try it out.
letseatfood
Definitely the way to go!
letseatfood