Jump to content

Is my PHP background task / Cron idea a good way to do this?


johnsmith153

Recommended Posts

I want to run certain tasks in the background and not on user request (e.g. send a transactional email and then based on the response do another action).

If I had a script which added this info to a database:

- PHP class
- PHP method
- parameters to pass to that method
- etc.

..and then every 5 minutes one Cron Task retrieved all the data from this database and executed those tasks (using class, method and params), is this secure?

It sounds a great idea to me. I could just store details of any class and method (and params) and have it run later.

If there was only one or two tasks then I suppose I could just write a specific script and execute as a Cron Task, but this gives me flexibility to run anything.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.