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.');
    	}
    }
    

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

     

  • 相关阅读:
    css知识小结(更新中)
    vim的简易操作
    shell语言学习(更新中)
    An Introduction to C & GUI Programming -----Simon Long 学习笔记 1
    fread,fwrite(二)
    fread,fwrite(一)
    printf 打印颜色
    容斥原理及证明
    字典的认识和使用 day05
    列表和元祖的使用 day 04
  • 原文地址:https://www.cnblogs.com/molang/p/2523458.html
Copyright © 2011-2022 走看看