最近在研究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.');
}
}
自己可以根据需求进行相应更改
浙公网安备 33010602011771号