[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.03 KiB
MD5: 601a85c2dc51f2b70ad9efe332a68e9c

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-2010 Zen Cart Development Team
  11.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  12.  * @version $Id: enable_error_logging.php 16900 2010-07-14 22:38:38Z drbyte $
  13.  */
  14. /**
  15.  * Specify the pages you wish to enable debugging for (ie: main_page=xxxxxxxx)
  16.  * Using '*' will cause all pages to be enabled
  17.  */
  18.   $pages_to_debug[] = '*';
  19.   $pages_to_debug[] = '';
  20.   $pages_to_debug[] = '';
  21.   $pages_to_debug[] = '';
  22.  
  23. /**
  24.  * The path where the debug log file will be located
  25.  * Default value is: DIR_FS_SQL_CACHE . '/myDEBUG-999999-00000000.log'
  26.  * ... which puts it in the /cache/ folder:   /cache/myDEBUG-999999-00000000.log  (where 999999 is a random number, and 00000000 is the server's timestamp)
  27.  */
  28.   $debug_logfile_path = DIR_FS_SQL_CACHE . '/myDEBUG-' . time() . '-' . mt_rand(1000,999999) . '.log';
  29.  
  30. /**
  31.  * Error reporting level to log
  32.  * Default: E_ALL ^E_NOTICE
  33.  */
  34.   $errors_to_log = (version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 6.0, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
  35.  
  36.  
  37. ///// DO NOT EDIT BELOW THIS LINE /////
  38.  
  39. //////////////////// DEBUG HANDLING //////////////////////////////////
  40.   if (in_array('*', $pages_to_debug) || in_array($current_page_base, $pages_to_debug)) {
  41.     @ini_set('log_errors', 1);          // store to file
  42.     @ini_set('log_errors_max_len', 0);  // unlimited length of message output
  43.     @ini_set('display_errors', 0);      // do not output errors to screen/browser/client
  44.     @ini_set('error_log', $debug_logfile_path);  // the filename to log errors into
  45.     @ini_set('error_reporting', $errors_to_log ); // log only errors according to defined rules
  46.   }
  47.