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