2 //give us true for mediaWiki
3 define( 'MEDIAWIKI', true );
5 define('MWEMBED_STANDALONE', true);
7 //setup the globals: (for documentation see: DefaultSettings.php )
9 $wgJSAutoloadLocalClasses = array();
11 $IP = realpath(dirname(__FILE__
).'/../');
13 //$wgMwEmbedDirectory becomes the root $IP
14 $wgMwEmbedDirectory = '';
16 $wgFileCacheDirectory = realpath(dirname(__FILE__
)) . '/script-cache';
18 $wgUseFileCache = true;
20 $wgEnableScriptLoaderJsFile = false;
24 $wgEnableScriptLocalization = true;
25 $mwLanguageCode = 'en';
27 $wgContLanguageCode ='';
29 $wgStyleVersion = '218';
31 $wgEnableScriptMinify = true;
37 * Default value for chmoding of new directories.
39 $wgDirectoryMode = 0777;
41 $wgJsMimeType = 'text/javascript';
43 //get the autoLoadClasses
44 require_once( realpath( dirname(__FILE__
) ) . '/jsAutoloadLocalClasses.php' );
46 //get the JSmin class:
47 require_once( realpath( dirname(__FILE__
) ) . '/minify/JSMin.php' );
49 //some static utility mediaWiki functions that we use:
50 function wfClientAcceptsGzip() {
53 # FIXME: we may want to blacklist some broken browsers
56 '/\bgzip(?:;(q)=([0-9]+(?:\.[0-9]+)))?\b/',
57 $_SERVER['HTTP_ACCEPT_ENCODING'],
59 if( isset( $m[2] ) && ( $m[1] == 'q' ) && ( $m[2] == 0 ) ) return false;
60 wfDebug( " accepts gzip\n" );
71 * Make directory, and make all parent directories if they don't exist
73 * @param string $dir Full path to directory to create
74 * @param int $mode Chmod value to use, default is $wgDirectoryMode
75 * @param string $caller Optional caller param for debugging.
78 function wfMkdirParents( $dir, $mode = null, $caller = null ) {
79 global $wgDirectoryMode;
81 if ( !is_null( $caller ) ) {
82 wfDebug( "$caller: called wfMkdirParents($dir)" );
85 if( strval( $dir ) === '' ||
file_exists( $dir ) )
88 if ( is_null( $mode ) )
89 $mode = $wgDirectoryMode;
91 return @mkdir
( $dir, $mode, true ); // PHP5 <3
93 function wfMsgNoTrans($msgKey){
94 global $messages, $mwLanguageCode;
95 //make sure we have the messages file:
96 require_once( realpath( dirname(__FILE__
) ) . '/languages/mwEmbed.i18n.php' );
98 if(isset($messages[$mwLanguageCode]) && isset($messages[$mwLanguageCode][$msgKey]) ){
99 return $messages[$mwLanguageCode][$msgKey];
101 return '<' . $msgKey . '>';