latest news to Harvey last week in the hardware network, due to the temporary needs of the original news platform did not completely stop using, so in the new platform began to find a headache after use, the homepage is always being updated for the original system, resulting in some news links not normal visit. The new system optimized URL, and the news page’s URL was different from the original one. The first time that people still use the old system in operation, can still occur within second days of such a situation, it should be thought of the old system, and later found the imperial CMS system has a default page refresh task, after the cancellation of a web page update is normal.
solve this problem, I was interested in the PHP task, before we know something, but not to truly practice, perhaps taking into account the importance of the function of the website system development, so I decided to look and write a set of mature code which is convenient for application.
first searches the Internet for relevant information, and by reading the data, we know that the PHP task can be broadly divided into three categories.
server plan task
WIN server can use the timing task directly to execute the associated application, and the LINUX server can implement the addition of timed tasks in the /etc/crontab.
automatically through the dead loop
set up a program file page to set the execution, can close the browser page by ignore_user_abort then, in running the program page, you need to plan will automatically execute the task. For PHP programmers, if there is not enough to grasp, this operation is not allowed, because the cycle of death is extremely easy to use server crashes.
triggered timed task
in my understanding of several procedures, such as Discuz, Empire, CMS, etc., are used in this way to complete the timing task of the system, compared to the previous two methods, which is the most safe and simple.
has so many choices, then when designing a program, you should choose the most appropriate way to do it according to your actual needs. Here is an example of an introduction.
love literature network electronic magazine on the website soon produced, which is transmitted through the electronic magazine of electronic mail, the latest issue of the magazine sent to subscribers in the mailbox is a huge work, simple page batch sending is obviously not possible. The main reason is that there is no own mail server, like news, Tencent and 163 provided by mail, despite the support of SMTP to send mail, but send email, but do not allow large quantities of limited conditions, then only through the program to solve the problem.
Powered By Impressive Business WordPress Theme