Home > Backend Development > PHP Tutorial > Thinkphp executes crond below, thinkphpcrond_PHP tutorial

Thinkphp executes crond below, thinkphpcrond_PHP tutorial

WBOY
Release: 2016-07-13 10:21:39
Original
1107 people have browsed it

Thinkphp execute crond below, thinkphpcrond

thinkphp enables cli support 1. tp just supports cli command mode, the path of the manual is 13.7.4 If the other framework you are using does not support cli, you can only write the program directly, which is actually writing the most basic process-oriented PHP code. 2. Open the command under the entry file and add a sentence define('MODE_NAME', 'cli'); Websites generally have modules that can be accessed through web pages, so you can create a new cli entrance such as index_cli.php, so that other modules can be entered through normal entrances. Some manuals state that the first cli definition is define('THINK_MODE ', 'cli'); , which may be due to different versions. Please pay attention to this.
/bin/php /home/nginx/html/pet/index.php Crond/test<br /><br />#上面是shell脚本执行 crond下面的test方法
Copy after login

For data addition in THINKPHP, why does the following code return an error every time? What went wrong?

1: Is there a primary key set for ID in your data table? If $id is the same value every time you insert it, the insertion will definitely fail. Set the id to auto-increment, delete $data['id']="$id"; and take a look first.
2: $oline = M("Oline");
$data["id"] = "$id";
$data["to"] = "$to";
$data["time"] = "$t";
$data["ip"] = "$_ip";
$oline->add($data);
echo $oline- >getlastsql();exit;
Copy the output sql statement directly to mysql and execute it to see what the cause of the error is

THINKPHP How can all methods in a class 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.

Actually, as you mentioned, there is an example in thinkphp that better meets your requirements
It’s called RBAC, which means permission control management
You can download the example on the official website, under the Example file Yes, that is: RBAC

As for the specific usage method, I recommend you watch this video, it is very detailed, step by step, and you’re good to go! !
www.tudou.com/programs/view/YyfoP5pzdBo/

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/853721.htmlTechArticleThinkphp Execute crond below, thinkphpcrond thinkphp to enable cli support 1. tp just supports cli command mode, the path of the manual is 13.7 .4 If you are using other frameworks that do not support cli, you can only directly...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template