Skip to content

Commit

Permalink
MDL-44187 JavaScript: Remove data from debug footer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 16, 2014
1 parent 692d247 commit 4e55f11
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
29 changes: 0 additions & 29 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -8859,35 +8859,6 @@ function get_performance_info() {
}
}

$jsmodules = $PAGE->requires->get_loaded_modules();
if ($jsmodules) {
$yuicount = 0;
$othercount = 0;
$details = '';
foreach ($jsmodules as $module => $backtraces) {
if (strpos($module, 'yui') === 0) {
$yuicount += 1;
} else {
$othercount += 1;
}
if (!empty($CFG->yuimoduledebug)) {
// Hidden feature for developers working on YUI module infrastructure.
$details .= "<div class='yui-module'><p>$module</p>";
foreach ($backtraces as $backtrace) {
$details .= "<div class='backtrace'>$backtrace</div>";
}
$details .= '</div>';
}
}
$info['html'] .= "<span class='includedyuimodules'>Included YUI modules: $yuicount</span> ";
$info['txt'] .= "includedyuimodules: $yuicount ";
$info['html'] .= "<span class='includedjsmodules'>Other JavaScript modules: $othercount</span> ";
$info['txt'] .= "includedjsmodules: $othercount ";
if ($details) {
$info['html'] .= '<div id="yui-module-debug" class="notifytiny">'.$details.'</div>';
}
}

if (!empty($PERF->logwrites)) {
$info['logwrites'] = $PERF->logwrites;
$info['html'] .= '<span class="logwrites">Log DB writes '.$info['logwrites'].'</span> ';
Expand Down
27 changes: 0 additions & 27 deletions lib/outputrequirementslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ class page_requirements_manager {
*/
protected $M_cfg;

/**
* @var array Stores debug backtraces from when JS modules were included in the page
*/
protected $debug_moduleloadstacktraces = array();

/**
* @var array list of requested jQuery plugins
*/
Expand Down Expand Up @@ -791,14 +786,6 @@ public function js_module($module) {
throw new coding_exception('Missing YUI3 module details.');
}

// Don't load this module if we already have, no need to!
if ($this->js_module_loaded($module['name'])) {
if ($CFG->debugdeveloper) {
$this->debug_moduleloadstacktraces[$module['name']][] = format_backtrace(debug_backtrace());
}
return;
}

$module['fullpath'] = $this->js_fix_url($module['fullpath'])->out(false);
// Add all needed strings.
if (!empty($module['strings'])) {
Expand Down Expand Up @@ -827,12 +814,6 @@ public function js_module($module) {
} else {
$this->YUI_config->add_module_config($module['name'], $module);
}
if ($CFG->debugdeveloper) {
if (!array_key_exists($module['name'], $this->debug_moduleloadstacktraces)) {
$this->debug_moduleloadstacktraces[$module['name']] = array();
}
$this->debug_moduleloadstacktraces[$module['name']][] = format_backtrace(debug_backtrace());
}
}

/**
Expand All @@ -851,14 +832,6 @@ protected function js_module_loaded($module) {
array_key_exists($modulename, $this->extramodules);
}

/**
* Returns the stacktraces from loading js modules.
* @return array
*/
public function get_loaded_modules() {
return $this->debug_moduleloadstacktraces;
}

/**
* Ensure that the specified CSS file is linked to from this page.
*
Expand Down

0 comments on commit 4e55f11

Please sign in to comment.