<?php
/**
- * mvwScriptLoader.php
+ * mwScriptLoader.php
* Script Loading Library for MediaWiki
*
* @file
* http://www.gnu.org/copyleft/gpl.html
*/
+//first do a quick static check for the cached file
+define('MW_CACHE_SCRIPT_CHECK', true);
+require_once( dirname(__FILE__) . '/js2/mwEmbed/jsScriptLoader.php');
+$myScriptLoader = new jsScriptLoader();
+if( $myScriptLoader->outputFromCache() ){
+ exit();
+}
+
+//Else load up mediaWiki stuff and continue scriptloader processing:
+
// include WebStart.php
+ob_start();
require_once('includes/WebStart.php');
+$webstartwhitespace = ob_end_clean();
-wfProfileIn( 'mvwScriptLoader.php' );
+wfProfileIn( 'mwScriptLoader.php' );
-if( isset( $_SERVER['SCRIPT_URL'] ) ) {
- $url = $_SERVER['SCRIPT_URL'];
-} else {
- $url = $_SERVER['PHP_SELF'];
-}
-
-if( strpos( $url, "mwScriptLoader$wgScriptExtension" ) === false ){
+if( $wgRequest->isPathInfoBad() ){
wfHttpError( 403, 'Forbidden',
- 'mvwScriptLoader must be accessed through the primary script entry point.' );
+ 'Invalid file extension found in PATH_INFO. ' .
+ 'mwScriptLoader must be accessed through the primary script entry point.' );
return;
}
// Verify the script loader is on:
die( 1 );
}
-// load the mwEmbed language file:
-$wgExtensionMessagesFiles['mwEmbed'] = "{$IP}/js2/mwEmbed/php/languages/mwEmbed.i18n.php";
-// enable the msgs before we go on:
-wfLoadExtensionMessages( 'mwEmbed' );
-
-// run jsScriptLoader action:
-$myScriptLoader = new jsScriptLoader();
+//load the language file and
+// Run jsScriptLoader action:
$myScriptLoader->doScriptLoader();
-wfProfileOut( 'mvwScriptLoader.php' );
\ No newline at end of file
+
+wfProfileOut( 'mwScriptLoader.php' );