mbrown Posted January 18, 2017 Share Posted January 18, 2017 I am creating a PHP application that the HOA board will use to do some online voting between the board. That being said I would like to have an async job run every 24 hours at 6:00p.m. that would see what motions users have not voted on and e-mail them to let them know they need to vote on it. Any suggestions would be greatly appreicated Quote Link to comment https://forums.phpfreaks.com/topic/302965-async-process-in-php/ Share on other sites More sharing options...
Jacques1 Posted January 18, 2017 Share Posted January 18, 2017 cronjob 1 Quote Link to comment https://forums.phpfreaks.com/topic/302965-async-process-in-php/#findComment-1541577 Share on other sites More sharing options...
mbrown Posted January 18, 2017 Author Share Posted January 18, 2017 Thanks Jacques. Just create the necessary php and let cronjob run it? Quote Link to comment https://forums.phpfreaks.com/topic/302965-async-process-in-php/#findComment-1541578 Share on other sites More sharing options...
ginerjm Posted January 18, 2017 Share Posted January 18, 2017 That's the idea. Although if this will be your first cron task, I suggest you write a script to do all the work while interacting with your console until you have it debugged. Use your email address to prove it out with results info and then eliminate any debugging outputs before setting it up to be a cron job. I use an email to do my debugging of cron tasks. I output all my debug info to a separate message body and then send out the debug email to my address to test my program and watch what it is doing. Once I'm through I disable the debugging email by turning off a switch in the top of the script. Quote Link to comment https://forums.phpfreaks.com/topic/302965-async-process-in-php/#findComment-1541581 Share on other sites More sharing options...
mbrown Posted February 5, 2017 Author Share Posted February 5, 2017 Thanks. Can you give me an example of the debug message you are speaking of? Quote Link to comment https://forums.phpfreaks.com/topic/302965-async-process-in-php/#findComment-1542315 Share on other sites More sharing options...
ginerjm Posted February 5, 2017 Share Posted February 5, 2017 You simply create an email - plain text is good - that contains the output of what you are trying to do in your script. Show variables as the script works along to ensure that it is doing what you expect. I then send the email to myself at the end. You can also use your address to send the 'real' output to yourself to ensure that it is sending the correct output. You can also avoid all of this simply by writing an ordinary script that outputs to the client until you get it right. Then you comment our the debugging echo statements and enable the email activity. Use a switch to control the debugging and another switch to control the actual email outputs. Ex. if ($debug) echo (something to help debug) .. .. .. if ($debug echo (something more to help debug) .. .. .. if ($send_emails) (call a function to send the production emails) Quote Link to comment https://forums.phpfreaks.com/topic/302965-async-process-in-php/#findComment-1542341 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.