From 253383006759ea5b9e8db91e2d5b9ba103f1c5a7 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 3 Jan 2007 01:37:20 +0000 Subject: [PATCH] $CFG->debugdisplay now controls PHP errors too --- lib/setup.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/setup.php b/lib/setup.php index eae03dd8a6..6739b2fa03 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -255,6 +255,15 @@ global $HTTPSPAGEREQUIRED; unset($originaldatabasedebug); error_reporting($CFG->debug); + +/// If we want to display Moodle errors, then try and set PHP errors to match + if (empty($CFG->debugdisplay)) { + @ini_set('display_errors', '0'); + @ini_set('log_errors', '1'); + } else { + @ini_set('display_errors', '1'); + } + /// Shared-Memory cache init -- will set $MCACHE /// $MCACHE is a global object that offers at least add(), set() and delete() /// with similar semantics to the memcached PHP API http://php.net/memcache -- 2.39.5