coding style cleanup for new files in js2 folder
[lhc/web/wiklou.git] / mwScriptLoader.php
1 <?php
2 /**
3 * mvwScriptLoader.php
4 * Script Loading Library for MediaWiki
5 *
6 * @file
7 * @author Michael Dale mdale@wikimedia.org
8 * @date feb, 2009
9 * @link http://www.mediawiki.org/wiki/ScriptLoader Documentation
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * http://www.gnu.org/copyleft/gpl.html
25 */
26
27 // include WebStart.php
28 require_once('includes/WebStart.php');
29
30 wfProfileIn( 'mvwScriptLoader.php' );
31
32 if( isset( $_SERVER['SCRIPT_URL'] ) ) {
33 $url = $_SERVER['SCRIPT_URL'];
34 } else {
35 $url = $_SERVER['PHP_SELF'];
36 }
37
38 if( strpos( $url, "mwScriptLoader$wgScriptExtension" ) === false ){
39 wfHttpError( 403, 'Forbidden',
40 'mvwScriptLoader must be accessed through the primary script entry point.' );
41 return;
42 }
43 // Verify the script loader is on:
44 if ( !$wgEnableScriptLoader ) {
45 echo '/*ScriptLoader is not enabled for this site. To enable add the following line to your LocalSettings.php';
46 echo '<pre><b>$wgEnableScriptLoader=true;</b></pre>*/';
47 echo 'alert(\'Script loader is disabled\');';
48 die( 1 );
49 }
50
51 // load the mwEmbed language file:
52 $wgExtensionMessagesFiles['mwEmbed'] = "{$IP}/js2/mwEmbed/php/languages/mwEmbed.i18n.php";
53 // enable the msgs before we go on:
54 wfLoadExtensionMessages( 'mwEmbed' );
55
56 // run jsScriptLoader action:
57 $myScriptLoader = new jsScriptLoader();
58 $myScriptLoader->doScriptLoader();
59
60 wfProfileOut( 'mvwScriptLoader.php' );