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
@@ -224,7 +224,7 @@ class page_requirements_manager {
));
// Set some more loader options applying to groups too.
if (debugging('', DEBUG_DEVELOPER)) {
if ($CFG->debugdeveloper) {
// When debugging is enabled, we want to load the non-minified (RAW) versions of YUI library modules rather
// than the DEBUG versions as these generally generate too much logging for our purposes.
// However we do want the DEBUG versions of our Moodle-specific modules.
@@ -270,7 +270,7 @@ class page_requirements_manager {
'jsrev' => ((empty($CFG->cachejs) or empty($CFG->jsrev)) ? -1 : $CFG->jsrev),
'svgicons' => $page->theme->use_svg_icons()
);
if (debugging('', DEBUG_DEVELOPER)) {
if ($CFG->debugdeveloper) {
$this->M_cfg['developerdebug'] = true;
}
@@ -436,7 +436,7 @@ class page_requirements_manager {
$this->jqueryplugins[$plugin]->urls = array();
foreach ($plugins[$plugin]['files'] as $file) {
if (debugging('', DEBUG_DEVELOPER)) {
if ($CFG->debugdeveloper) {
if (!file_exists("$componentdir/jquery/$file")) {
debugging("Invalid file '$file' specified in jQuery plugin '$plugin' in component '$component'");
continue;
@@ -746,7 +746,7 @@ class page_requirements_manager {
// Don't load this module if we already have, no need to!
if ($this->js_module_loaded($module['name'])) {
if (debugging('', DEBUG_DEVELOPER)) {
if ($CFG->debugdeveloper) {
$this->debug_moduleloadstacktraces[$module['name']][] = format_backtrace(debug_backtrace());
}
return;
@@ -780,7 +780,7 @@ class page_requirements_manager {
} else {
$this->YUI_config->add_module_config($module['name'], $module);
}
if (debugging('', DEBUG_DEVELOPER)) {
if ($CFG->debugdeveloper) {
if (!array_key_exists($module['name'], $this->debug_moduleloadstacktraces)) {
$this->debug_moduleloadstacktraces[$module['name']] = array();
}