[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 enable_error_logging.php

Zen Cart 源代码 enable_error_logging.php




下载文件

文件名: enable_error_logging.php
文件类型: PHP文件
文件大小: 2.38 KiB
MD5: 6bb2234d1fac4fb988b2ab6a86d70c4c

enable_error_logging.php - 关闭高亮
  1. <?php
  2. /**
  3.  * Very simple error logging to file
  4.  *
  5.  * Sometimes it is difficult to debug PHP background activities
  6.  * However, using the PHP error logging facility we can store all PHP errors to a file, and then review separately.
  7.  * Using this method, the debug details are stored at: /cache/myDEBUG-999999-00000000.log
  8.  *
  9.  * @package debug
  10.  * @copyright Copyright 2003-2012 Zen Cart Development Team
  11.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  12.  * @version GIT: $Id: Author: DrByte  Tue Aug 28 16:48:39 2012 -0400 Modified in v1.5.1 $
  13.  */
  14.  
  15. if (!defined('DIR_FS_LOGS')) {
  16.   $val = realpath(dirname(DIR_FS_SQL_CACHE . '/') . '/logs');
  17.   if (is_dir($val) && is_writable($val)) {
  18.     define('DIR_FS_LOGS', $val);
  19.   }
  20.   else {
  21.     define('DIR_FS_LOGS', DIR_FS_SQL_CACHE);
  22.   }
  23. }
  24. /**
  25.  * Specify the pages you wish to enable debugging for (ie: main_page=xxxxxxxx)
  26.  * Using '*' will cause all pages to be enabled
  27.  */
  28.   $pages_to_debug[] = '*';
  29. //   $pages_to_debug[] = '';
  30. //   $pages_to_debug[] = '';
  31.  
  32. /**
  33.  * The path where the debug log file will be located
  34.  * Default value is: DIR_FS_LOGS . '/myDEBUG-999999-00000000.log'
  35.  * ... which puts it in the /logs/ folder:   /logs/myDEBUG-999999-00000000.log  (where 999999 is a random number, and 00000000 is the server's timestamp)
  36.  *    (or if you don't have a /logs/ folder, it will use the /cache/ folder instead)
  37.  */
  38.   $debug_logfile_path = DIR_FS_LOGS . '/myDEBUG-' . time() . '-' . mt_rand(1000,999999) . '.log';
  39.  
  40. /**
  41.  * Error reporting level to log
  42.  * Default: E_ALL ^E_NOTICE
  43.  */
  44.   $errors_to_log = (version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 5.4, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
  45.  
  46.  
  47. ///// DO NOT EDIT BELOW THIS LINE /////
  48.  
  49. //////////////////// DEBUG HANDLING //////////////////////////////////
  50.   if (in_array('*', $pages_to_debug) || in_array($current_page_base, $pages_to_debug)) {
  51.     @ini_set('log_errors', 1);          // store to file
  52.     @ini_set('log_errors_max_len', 0);  // unlimited length of message output
  53.     @ini_set('display_errors', 0);      // do not output errors to screen/browser/client
  54.     @ini_set('error_log', $debug_logfile_path);  // the filename to log errors into
  55.     @ini_set('error_reporting', $errors_to_log ); // log only errors according to defined rules
  56.   }
  57.