- 註冊時間
- 2006-3-13
- 最後登錄
- 2025-1-10
- 在線時間
- 673 小時
- 閱讀權限
- 200
- 積分
- 417
- 帖子
- 1107
- 精華
- 0
- UID
- 2
  
|
在很多程式當中都有判斷 DEBUG_MODE 的部分, 對於想要修改 ECSHOP 系統的人能弄清楚的話會有所幫助。
設定的位置就在 data/config.php 中,請在開頭加入- //除錯用開關
- define('DEBUG_MODE', 0
- //+ 1 //錯誤報告全部顯示
- //+ 2 //停用 Smarty Cache (改前台樣版時好用)
- //+ 4 //啟用 lib.debug
- //+ 8 //紀錄資料庫SQL查詢
- );
複製代碼 想要開啟某個功能就將左側註解符號移除,以下是從程式當中分析出來的狀況:
DEBUG_MODE & 1 = True 時
前台錯誤報告模式 includes/init.php
後台錯誤報告模式 admin/includes/init.php
error_reporting(E_ALL);
DEBUG_MODE & 1 = False 時
前台錯誤報告模式 includes/init.php
後台錯誤報告模式 admin/includes/init.php
error_reporting(E_ALL ^ E_NOTICE);
DEBUG_MODE & 2 = True 時
前台
$smarty->direct_output = true;
$smarty->force_compile = true;
後台
$smarty->force_compile = true;
會忽略讀取快取檔案功能 [includes/lib_base.php read_static_cache()]
會忽略產生快取檔案功能 [includes/lib_base.php write_static_cache()]
DEBUG_MODE & 2 = False 時
前台
$smarty->direct_output = false;
$smarty->force_compile = false;
DEBUG_MODE & 4 = True 時
前台 includes/init.php
後台 admin/includes/init.php
include(ROOT_PATH . 'includes/lib.debug.php');
會產生 log.txt 檔案 [includes/lib_base.php log_write()]
DEBUG_MODE & 8 = True 時
紀錄查詢的 SQL [includes/cls_mysql.php query()]
會存放在 data/mysql_query_hash_Y_M_D.log |
|