Jump to content

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


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.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.