-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathThisIsNotAWikiSettings.php
64 lines (54 loc) · 1.44 KB
/
ThisIsNotAWikiSettings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
wfLoadExtension( 'ThisIsNotAWiki' );
// File caches
$wgUseFileCache = true;
$wgFileCacheDepth = 0;
$wgFileCacheDirectory = '/workspace/dist';
// Contents
$wgSitename = 'This Is Not A Wiki';
$wgCapitalLinks = false;
$wgRestrictDisplayTitle = false;
$wgUseInstantCommons = true;
// Etc
$wgJobRunRate = 0;
unset( $wgFooterIcons['poweredby'] );
// Skin
$wgVectorDefaultSkinVersion = '2';
$wgVectorStickyHeader = [ 'logged_out' => true ];
$wgVectorLanguageInHeader = $wgVectorStickyHeader;
$wgVectorResponsive = true;
// Read configurations from .nowiki.json
if ( file_exists( '/workspace/src/.nowiki.json' ) ) {
$text = file_get_contents( '/workspace/src/.nowiki.json' );
$config = json_decode( $text, true );
// Skins
if ( isset( $config['skin'] ) ) {
wfLoadSkin( $config['skin'] );
$wgDefaultSkin = strtolower( $config['skin'] );
unset( $config['skin'] );
}
// Extensions
if ( isset( $config['Extensions'] ) ) {
if ( is_array( $config['Extensions'] ) ) {
wfLoadExtensions( $config['Extensions'] );
}
unset( $config['Extensions'] );
}
// wg variables
if ( isset( $config['wg'] ) ) {
foreach ( $config['wg'] as $key => $val ) {
$key = 'wg' . $key;
$GLOBALS[$key] = $val;
}
unset( $config['wg'] );
}
// Etc
if ( isset( $config['Url'] ) ) {
$wgThisIsNotAWikiFooterUrl = $config['Url'];
unset( $config['Url'] );
}
foreach ( $config as $key => $val ) {
$key = 'wgThisIsNotAWiki' . $key;
$GLOBALS[$key] = $val;
}
}