Run crond and thinkphpcrond in Thinkphp.
Enable cli support for thinkphp1. tp supports cli command mode. The path of the Manual is 13.7.4. If other frameworks do not support cli, you can only write programs directly, it is actually the most basic php code for process-oriented writing. 2. Open the command in the portal file and add a define ('mode _ name', 'cl'). The website generally has modules that can be accessed through webpages, therefore, you can create a cli entry such as index_cli.php, so that other modules can enter through the normal portal. In some manuals, the cli defines define ('Think _ mode', 'cli '). It may be of different versions. Pay attention to this.
/Bin/php/home/nginx/html/pet/index. php Crond/test
# The above is the test method executed by the shell script under crond
Why does the following code always return an error when adding data in THINKPHP?
1: Does the id of your data table set a primary key? If you insert $ id with the same value each time, the insertion will fail. Set id to auto-increment, and delete $ data ['id'] = "$ id.
2: $ oline = M ("Oline ");
$ Data ["id"] = "$ id ";
$ Data ["to"] = "$ ";
$ Data ["time"] = "$ t ";
$ Data ["ip"] = "$ _ ip ";
$ Oline-> add ($ data );
Echo $ oline-> getlastsql (); exit;
Copy the output SQL statement to mysql for execution.
How does THINKPHP allow all methods in a class to execute a verification method before execution?
If it is simple, you can first write a class, execute some verification methods in this class, and then let the class you execute inherit from this class.
In fact, there is a better example in thinkphp that meets your requirements.
It is called RBAC, that is, permission control management.
You can go to the following Example on the official website: RBAC in the Example file.
As for the specific usage method, we recommend that you take a look at this video, which is very detailed. You can proceed step by step !!
Www.tudou.com/programs/view/YyfoP5pzdBo/