thinkphp turn debug mode off to generate cache _php Tutorial

Source: Internet
Author: User
Tags constant definition
This article to introduce a about thinkphp open debug mode to cancel the build cache, there is a need to know friends can refer to this article.

Recently back to thinkphp found that the old version of the shutdown cache said the common of the two closed cache files are missing. I've been looking for a long time without knowing what's going on.

So go to read the handbook, see Baidu. Later found that you can turn on debug mode to close the cache, and open debug mode for programmers there are many advantages of OH.

In the thinkphp3.0 full development manual inside search debugging two words, you find a lot of tricks back. Here are the steps to turn on the debug feature

Although the compilation cache is very good, but not conducive to debugging and troubleshooting in the development phase, we strongly recommend that thinkphp developers in the development phase always open debugging mode, easy to detect hidden problems and analysis, solve problems. Turning on debug mode is simple, just add a line of constant definition code to the portal file:

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

The code is as follows Copy Code

Require './thinkphp/thinkphp.php ';
Define (' App_debug ', 1);
?>


After the development phase is deployed to the production environment, you only need to remove the debug mode definition code to switch to the deployment mode.


When debug mode is turned on, the system will load the default debug profile and then load the project's debug profile, with the advantage of the debug mode:


² Open Logging, any error messages and debugging information will be detailed records, easy to debug;


² Close Template Cache, template modification can be effective immediately;


² Log SQL logs for easy analysis of SQL;


² Close the field cache and the data table fields are not affected by the cache;


² Check file capitalization (even on Windows platforms) to help you discover Linux deployment issues in advance;


²
Can be easily used in different stages of the development process, including development, testing and demonstration of any need, different application patterns can be configured to separate project configuration files;


For more usage of debug mode, we'll explain it in more detail later.

http://www.bkjia.com/PHPjc/629133.html www.bkjia.com true http://www.bkjia.com/PHPjc/629133.html techarticle This article to introduce a about thinkphp open debug mode to cancel the build cache, there is a need to know friends can refer to this article. Recently returned to thinkphp to discover the previous old version of the shutdown ...

  • Related Article

    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.