The CRON calls the first app in the sequence… that app may set a session variable that needs to get passed to the next app.
My Real World Example:
Cron calls App “Queue processor”
Queue processor checks for records in “queue” table in database.
When record is found it takes that record number and looks up data required to “process” the item.
Queue Processor redirects to App “Process item” passing it the item # from queue table.
Process Item app may need to call various other apps to complete processing of item… each app takes a session or GET variable from URL to know what item to do its job on.
I have this working using CURL now… but it won’t work with SC_REDIR macro. Using CURL I pass the variable on the URL… which limits me perhaps a little… would be nice if I could pass POST variables or session variables using SC_REDIR.
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://192.168.0.127:8090/scriptcase/app/MyProject/RedirectTest2/RedirectTest2.php?data=From%20Curl1&data2=From%20Curl%20also");
curl_setopt($ch, CURLOPT_HEADER, false);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
App called "RedirectTest1.php writes one record to a table in the DB, then passes to app RedirectTest2.php the variables “data” and “data2”… app RedirectTest2.php write those variable to the database.
This way I can see it working.
As I said the only downside to this is requiring me to use GET variables via URL… I would like to use session [VARIABLES] perhaps… but don’t know if that would be possible.
Thanks!