Skip to content

Instantly share code, notes, and snippets.

@allen501pc
Created August 2, 2012 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allen501pc/3234928 to your computer and use it in GitHub Desktop.
Save allen501pc/3234928 to your computer and use it in GitHub Desktop.
Initialization of settings for PHP.
<?php
/* Author: Allen (allen501pc@gmail.com)
Brief: Initialization of settings for PHP.
Date: August 2, 2012.
*/
/* 開啟Debug模式 */
define("IS_DEBUG_MODE",1);
if(IS_DEBUG_MODE)
{
/* 初始化環境設定 */
/* 注意!E_ALL在PHP 6以下的版本,並不包含E_STRICT。但是在PHP6以上的版本,卻包含E_STRICT */
ini_set('error_reporting', E_ALL | E_STRICT);
/* display_errors 預設為 On,當執行php網頁發生錯誤時,會將錯誤、警告訊息顯示在網頁上 */
ini_set('display_errors', 1);
/* 如果display_startup_errors設定為Off,縱使display_errors設定為On,也不會顯示在網頁上。 */
ini_set('display_startup_errors', 1);
}
else
{
/* 關閉Error輸出記錄 */
ini_set('display_startup_errors',0);
ini_set('display_errors',0);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment