From e63f95d7c14fa02221695defdfe22a0d01d5e346 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 28 Mar 2012 16:39:42 +0200 Subject: [PATCH] MDL-12730 new debug levels (support strict) + upgrade from old ones --- lib/db/upgrade.php | 10 ++++++++++ lib/setuplib.php | 20 ++++++++++---------- version.php | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 4db1d7b3bf1..28d37ec795d 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -335,6 +335,16 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012032300.01); } + if ($oldversion < 2012032300.02) { + // Migrate the old admin debug setting. + if ($CFG->debug == 38911) { + set_config('debug', DEBUG_DEVELOPER); + } else if ($CFG->debug == 6143) { + set_config('debug', DEBUG_ALL); + } + upgrade_main_savepoint(true, 2012032300.02); + } + return true; } diff --git a/lib/setuplib.php b/lib/setuplib.php index e217d9a063a..55d8998f477 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -27,17 +27,17 @@ defined('MOODLE_INTERNAL') || die(); -// Debug levels // -/** no warnings at all */ +// Debug levels - always keep the values in ascending order! +/** No warnings and errors at all */ define('DEBUG_NONE', 0); -/** E_ERROR | E_PARSE */ -define('DEBUG_MINIMAL', 5); -/** E_ERROR | E_PARSE | E_WARNING | E_NOTICE */ -define('DEBUG_NORMAL', 15); -/** E_ALL without E_STRICT for now, do show recoverable fatal errors */ -define('DEBUG_ALL', 6143); -/** DEBUG_ALL with extra Moodle debug messages - (DEBUG_ALL | 32768) */ -define('DEBUG_DEVELOPER', 38911); +/** Fatal errors only */ +define('DEBUG_MINIMAL', E_ERROR | E_PARSE); +/** Errors, warnings and notices */ +define('DEBUG_NORMAL', E_ERROR | E_PARSE | E_WARNING | E_NOTICE); +/** All problems except strict PHP warnings */ +define('DEBUG_ALL', E_ALL & ~E_STRICT); +/** DEBUG_ALL with all debug messages and strict warnings */ +define('DEBUG_DEVELOPER', E_ALL | E_STRICT); /** Remove any memory limits */ define('MEMORY_UNLIMITED', -1); diff --git a/version.php b/version.php index b2ed9982d73..f0295b951da 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012032300.01; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012032300.02; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes