Bug 20489 Configure illegal file characters https://bugzilla.wikimedia.org/show_bug...
[mediawiki.git] / js2 / mwEmbed / php / noMediaWikiConfig.php
blob5c066189deb7195c8495e480d1efe6e011eda7dd
1 <?php
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;
23 /*Localization:*/
24 $wgEnableScriptLocalization = true;
25 $mwLanguageCode = 'en';
27 $wgContLanguageCode ='';
29 $wgStyleVersion = '218';
31 $wgEnableScriptMinify = true;
33 $wgUseGzip = true;
36 /**
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() {
51 global $wgUseGzip;
52 if( $wgUseGzip ) {
53 # FIXME: we may want to blacklist some broken browsers
54 $m = array();
55 if( preg_match(
56 '/\bgzip(?:;(q)=([0-9]+(?:\.[0-9]+)))?\b/',
57 $_SERVER['HTTP_ACCEPT_ENCODING'],
58 $m ) ) {
59 if( isset( $m[2] ) && ( $m[1] == 'q' ) && ( $m[2] == 0 ) ) return false;
60 wfDebug( " accepts gzip\n" );
61 return true;
64 return false;
66 function wfDebug(){
67 return false;
70 /**
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.
76 * @return bool
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 ) )
86 return true;
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];
100 }else{
101 return '&lt;' . $msgKey . '&gt;';