summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2006-07-08 01:25:25 +0200
committerBen Coburn <btcoburn@silicodon.net>2006-07-08 01:25:25 +0200
commitbad905f13d90b80add3f028b9f6c77e071e0d746 (patch)
tree60bfc1fa0a56e2eac25e320b70fef750696bb0c5
parentf183a5b7b0f8b98ee616e6c7a93aa796b9e65d70 (diff)
downloadrpg-bad905f13d90b80add3f028b9f6c77e071e0d746.tar.gz
rpg-bad905f13d90b80add3f028b9f6c77e071e0d746.tar.bz2
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
-rw-r--r--inc/init.php8
-rw-r--r--inc/parser/xhtml.php4
2 files changed, 8 insertions, 4 deletions
diff --git a/inc/init.php b/inc/init.php
index aa0219f43..2d194aa09 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -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;
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 5f6bb5539..d7a9a1ef4 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -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']){