Merge branch 'MDL-44187-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Damyon Wiese 2014-02-18 13:56:11 +08:00
commit b41ea78c39
2 changed files with 0 additions and 56 deletions

View File

@ -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> ';

View File

@ -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
*/
@ -791,14 +786,6 @@ class page_requirements_manager {
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'])) {
@ -827,12 +814,6 @@ class page_requirements_manager {
} 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());
}
}
/**
@ -851,14 +832,6 @@ class page_requirements_manager {
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.
*