error reporting E_ALL switch

- Adds a constant DOKU_E_LEVEL for globally overriding the error reporting level.
  - Adds a file based switch for enabling E_ALL errors without changing the code.

This is convenient for developers debugging new patches. It also ensures that
the new patch will not accidentally record manual changes to the error reporting
level. To enable E_ALL errors globally, create the file 'conf/report_e_all'.

darcs-hash:20060707232525-05dcb-0f24e53783f546a83268fe40b0d8b68f4d6ccfa6.gz
This commit is contained in:
Ben Coburn 2006-07-08 01:25:25 +02:00
parent f183a5b7b0
commit bad905f13d
2 changed files with 8 additions and 4 deletions

View File

@ -16,8 +16,12 @@
// define config path (packagers may want to change this to /etc/dokuwiki/)
if(!defined('DOKU_CONF')) define('DOKU_CONF',DOKU_INC.'conf/');
// set up error reporting to sane values
error_reporting(E_ALL ^ E_NOTICE);
// check for error reporting override or set error reporting to sane values
if (!defined('DOKU_E_LEVEL') && file_exists(DOKU_CONF.'report_e_all')) {
define('DOKU_E_LEVEL', E_ALL);
}
if (!defined('DOKU_E_LEVEL')) { error_reporting(E_ALL ^ E_NOTICE); }
else { error_reporting(DOKU_E_LEVEL); }
//prepare config array()
global $conf;

View File

@ -793,9 +793,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$feed->feed_url($url);
//disable warning while fetching
$elvl = error_reporting(E_ERROR);
if (!defined('DOKU_E_LEVEL')) { $elvl = error_reporting(E_ERROR); }
$rc = $feed->init();
error_reporting($elvl);
if (!defined('DOKU_E_LEVEL')) { error_reporting($elvl); }
//decide on start and end
if($params['reverse']){