bestlong 怕失憶論壇

標題: ECSHOP 的 DEBUG_MODE 功能 [打印本頁]

作者: bestlong    時間: 2010-12-5 11:57     標題: ECSHOP 的 DEBUG_MODE 功能

在很多程式當中都有判斷 DEBUG_MODE 的部分, 對於想要修改 ECSHOP 系統的人能弄清楚的話會有所幫助。

設定的位置就在 data/config.php 中,請在開頭加入
  1. //除錯用開關
  2. define('DEBUG_MODE', 0
  3. //+ 1 //錯誤報告全部顯示
  4. //+ 2 //停用 Smarty Cache (改前台樣版時好用)
  5. //+ 4 //啟用 lib.debug
  6. //+ 8 //紀錄資料庫SQL查詢
  7. );
複製代碼
想要開啟某個功能就將左側註解符號移除,以下是從程式當中分析出來的狀況:

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




歡迎光臨 bestlong 怕失憶論壇 (http://www.bestlong.idv.tw/) Powered by Discuz! X1.5