Thinkphp enables debugging mode to cancel cache generation

Source: Internet
Author: User
Tags constant definition

This article describes how to enable the debugging mode of thinkphp to cancel cache generation. For more information, see this article.

Recently, I returned to thinkphp and found that the two files in the "common" mentioned in the earlier version of "Disable cache" were missing. I have been searching for a long time and don't know what's going on.

So I went to the manual and read Baidu. Later I found that I can enable the debugging mode to disable caching, and enable the debugging mode has many advantages for programmers ..

 

Search and debug two words in the thinkphp3.0 full development manual, and you will find many tips. The following describes how to enable the debugging function.

 

Although the compilation cache is excellent, it is not conducive to debugging and troubleshooting during the development phase. We strongly recommend that ThinkPHP developers always enable the debugging mode during the development phase, it is convenient to promptly discover and analyze and solve hidden problems. To enable the debugging mode, you only need to add a constant definition code in the entry file:

The code in my index. php is shared with you:

The Code is as follows: Copy code

<? Php
Require './ThinkPHP. php ';
Define ('app _ debug', 1 );
?>


After the development phase is deployed to the production environment, you only need to delete the debugging mode and define the code to switch to the deployment mode.


After the debugging mode is enabled, the system first loads the default debugging configuration file of the system, and then adds the debugging configuration file for the purpose of the add-on. The debugging mode has the following advantages:


2. Enable Logging. All error information and debugging information are recorded in detail to facilitate debugging;


2. Disable template caching. template modifications can take effect immediately;


2. Record SQL logs to facilitate SQL analysis;


2. Disable field caching. Modifying data table fields is not affected by caching;


2. Check file case sensitivity (even on Windows) to help you detect Linux deployment problems in advance;


2.
It can be conveniently used in different stages of the development process, including development, testing, demonstration, and other situations. Different application modes can be used to configure independent project configuration files;


We will explain more about the debugging mode later.

 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.