MDL-39474 introduce $CFG->debugdeveloper and cleanup $CFG init

This commit is contained in:
Petr Škoda
2013-08-12 13:01:47 +02:00
parent 50ff861263
commit 96f81ea385
43 changed files with 192 additions and 185 deletions
+5 -5
View File
@@ -7689,8 +7689,8 @@ function get_string($identifier, $component = '', $a = null, $lazyload = false)
return new lang_string($identifier, $component, $a);
}
if (debugging('', DEBUG_DEVELOPER) && clean_param($identifier, PARAM_STRINGID) === '') {
throw new coding_exception('Invalid string identifier. The identifier cannot be empty. Please fix your get_string() call.');
if ($CFG->debugdeveloper && clean_param($identifier, PARAM_STRINGID) === '') {
throw new coding_exception('Invalid string identifier. The identifier cannot be empty. Please fix your get_string() call.', DEBUG_DEVELOPER);
}
// There is now a forth argument again, this time it is a boolean however so
@@ -8240,7 +8240,7 @@ function get_list_of_plugins($directory='mod', $exclude='', $basedir='') {
$basedir = $basedir .'/'. $directory;
}
if (empty($exclude) and debugging('', DEBUG_DEVELOPER)) {
if ($CFG->debugdeveloper and empty($exclude)) {
// Make sure devs do not use this to list normal plugins,
// this is intended for general directories that are not plugins!
@@ -11166,8 +11166,8 @@ class lang_string {
// Check if we need to process the string.
if ($this->string === null) {
// Check the quality of the identifier.
if (debugging('', DEBUG_DEVELOPER) && clean_param($this->identifier, PARAM_STRINGID) === '') {
throw new coding_exception('Invalid string identifier. Most probably some illegal character is part of the string identifier. Please check your string definition');
if ($CFG->debugdeveloper && clean_param($this->identifier, PARAM_STRINGID) === '') {
throw new coding_exception('Invalid string identifier. Most probably some illegal character is part of the string identifier. Please check your string definition', DEBUG_DEVELOPER);
}
// Process the string.