The example in this article describes the process usage of the thinkphp progress Count class. Share to everyone for your reference. Specifically as follows:
There is a requirement in the project to limit the number of processes because a background task compares bandwidth. Spent a bit of time, wrote the class, the current version of the function is relatively simple.
Process.class.php files are as follows:
<?php/** * Process * @package * @version $id $ * @copyright 2005-2011 sucop.com * @author Dijia Huang
Call Method:
<?php
class Indexaction extends Action
{
//Initialize module public
function _initialize () {
parent::_ Initialize ();
Import (' @. Util.process ');
Process::start ();
}
function __destruct () {
Process:: Destory ();
}
Else ' not exceeding limit ';
}
? >
I hope this article will help you with the PHP program design based on thinkphp framework.