MDL-40563 improve yui serving performance

It is not necessary to do full page init to access the plugin locations API.
This commit is contained in:
Petr Škoda 2013-07-12 22:34:12 +02:00
parent 23ee749bfb
commit cba94cec14
2 changed files with 2 additions and 14 deletions

View file

@ -87,12 +87,6 @@ foreach ($parts as $part) {
$content .= "\n// Incorrect moodle module inclusion. Not enough component information in {$part}.\n";
continue;
}
if (!defined('ABORT_AFTER_CONFIG_CANCEL')) {
define('ABORT_AFTER_CONFIG_CANCEL', true);
define('NO_UPGRADE_CHECK', true);
define('NO_MOODLE_COOKIES', true);
require($CFG->libdir.'/setup.php');
}
$revision = (int)array_shift($bits);
if ($revision === -1) {
// Revision -1 says please don't cache the JS
@ -101,7 +95,7 @@ foreach ($parts as $part) {
$frankenstyle = array_shift($bits);
$filename = array_pop($bits);
$modulename = $bits[0];
$dir = get_component_directory($frankenstyle);
$dir = core_component::get_component_directory($frankenstyle);
// For shifted YUI modules, we need the YUI module name in frankenstyle format.
$frankenstylemodulename = join('-', array($version, $frankenstyle, $modulename));

View file

@ -41,17 +41,11 @@ $etag = sha1($path);
$parts = explode('/', $path);
$version = array_shift($parts);
if ($version == 'moodle' && count($parts) >= 3) {
if (!defined('ABORT_AFTER_CONFIG_CANCEL')) {
define('ABORT_AFTER_CONFIG_CANCEL', true);
define('NO_UPGRADE_CHECK', true);
define('NO_MOODLE_COOKIES', true);
require($CFG->libdir.'/setup.php');
}
$frankenstyle = array_shift($parts);
$module = array_shift($parts);
$image = array_pop($parts);
$subdir = join('/', $parts);
$dir = get_component_directory($frankenstyle);
$dir = core_component::get_component_directory($frankenstyle);
// For shifted YUI modules, we need the YUI module name in frankenstyle format.
$frankenstylemodulename = join('-', array($version, $frankenstyle, $module));