Upper-case DOCTYPE in HTML5 for well-formedness
[lhc/web/wiklou.git] / mwScriptLoader.php
index e307938..4755f84 100644 (file)
@@ -1,6 +1,6 @@
 <?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( strpos( wfGetScriptUrl(), "mwScriptLoader.php" ) === 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:
@@ -43,12 +55,9 @@ if ( !$wgEnableScriptLoader ) {
        die( 1 );
 }
 
-//moved to setup.php
-// load the mwEmbed language file:
-//$wgExtensionMessagesFiles['mwEmbed'] = "{$IP}/js2/mwEmbed/php/languages/mwEmbed.i18n.php";
-
-// 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' );