How to adjust the error level of CodeIgniter _php tutorial

Source: Internet
Author: User
When we do not use CI, we can use error_reporting (E_all); error_reporting (0); This type of code to control the error level. Of course, these statements can be used in classes, but CI itself has a mechanism to control the error level.

You may not always open index.php, but the changes are in this file:

/* *---------------------------------------------------------------* Application Environment *-------------------- -------------------------------------------* * can load different configurations depending on your * current ENVIRONM Ent. Setting the environment also influences * things like logging and error reporting.  * * This can being set to anything, but the default usage is: * * development * TESTING * production * * Note:if Change these, also change the error_reporting () code below * */define (' environment ', ' development ');/* *----------------- ----------------------------------------------* ERROR REPORTING *------------------------------------------------ ---------------* * Different environments would require Different levels of error reporting. * By default development would show errors but testing and live would hide them. */if (defined (' environment ')) {switch (Environment) {case ' development ': error_reporting (e_all); Break;case ' testing ': Case ' production ': Error_reportiNg (0); Break;default:exit (' The application environment is not set correctly. ');}} 

Environment is to control the error level, the default has three options, development testing production, by the above switch statement control. The code is already clear and can be changed to suit your needs.

http://www.bkjia.com/PHPjc/752348.html www.bkjia.com true http://www.bkjia.com/PHPjc/752348.html techarticle when we do not use CI, we can use Error_reporting (E_all), error_reporting (0); This kind of code to control the error level. Of course, you can also use these statements in your class, but CI ...

  • 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.