zoukankan      html  css  js  c++  java
  • ci 框架 报错级别 调整

    最近在研究CI框架,ci框架的报错级别控制文件 在根目录下的index.php中

    在大约29行 附近 有个

     1 /*
     2  *---------------------------------------------------------------
     3  * APPLICATION ENVIRONMENT
     4  *---------------------------------------------------------------
     5  *
     6  * You can load different configurations depending on your
     7  * current environment. Setting the environment also influences
     8  * things like logging and error reporting.
     9  *
    10  * This can be set to anything, but default usage is:
    11  *
    12  *     development
    13  *     testing
    14  *     production
    15  *
    16  * NOTE: If you change these, also change the error_reporting() code below
    17  *
    18  */
    19     define('ENVIRONMENT', 'development');

    ENVIRONMENT 就是来控制报错级别的,默认的有三个选项,development  testing production,由下面的语句控制

    /*
     *---------------------------------------------------------------
     * ERROR REPORTING
     *---------------------------------------------------------------
     *
     * Different environments will require different levels of error reporting.
     * By default development will show errors but testing and live will 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.');
    	}
    }
    

     自己可以根据需求进行相应更改

     

  • 相关阅读:
    某题2
    某题1
    某题
    DAY 7
    DAY 4
    数据结构(六)图
    【转载】大数据面试知识图谱
    数据结构(四)二叉树
    Scala(一)基础
    Java虚拟机(一)
  • 原文地址:https://www.cnblogs.com/molang/p/2523458.html
Copyright © 2011-2022 走看看