To implement scheduler task control in PHP, you need to control the scheduler task list in the PHP script. the function is as follows: set five files that need to be scheduled to run regularly (can be added, deleted, or modified). These five files run through a php file plan. php control, and then use the linux crontab to directly run this plan. PHP file to achieve the effect of running the five files at the same time. PHP implements scheduled task control.
You need to control the scheduler task list in the PHP script to implement the following functions:
Set five files that need to be scheduled to run regularly (can be added, deleted, or modified). These five files run through a php file plan. php control, and then use the linux crontab to directly run this plan. php file to run the five files at the same time.
Q: How does plan. php implement control over these five files that really require timed running ?? Directly include (require/require_once, include/include_once.
I hope my friends who are familiar with this function will tell me, thanks to ing .....
------ Solution --------------------
Use this function
Ignore_user_abort (true); // The PHP script can be executed even if the Client is disconnected (such as the browser is disabled.
// Determine the trigger condition
// Execute the corresponding function (files can be loaded as needed)
------ Solution --------------------
You can store the program to be automatically executed, the execution cycle, and the next execution time through the design data table. plan. php reads the table and determines whether the program can be executed. Crontab regularly executes plan. php.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service