-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSMWFarm.php
More file actions
56 lines (49 loc) · 1.28 KB
/
Copy pathSMWFarm.php
File metadata and controls
56 lines (49 loc) · 1.28 KB
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
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'Not an entry point.' );
}
define( 'SMWFARM_VERSION', '0.1' );
// Registration of the extension credits, see Special:Version.
$wgExtensionCredits['semfarm'][] = array(
'path' => __FILE__,
'name' => 'Semantic MediaWiki Farm',
'version' => SMWFARM_VERSION,
'author' => array(
'...'
),
'url' => 'https://semantic-mediawiki.org',
'descriptionmsg' => 'smwfarm-desc'
);
#flag to spot if wiki exists
$wikiExists=0;
foreach ( $wikiConfigList as $wikiConfig ) {
if($_SERVER["SERVER_NAME"]==$wikiConfig['url'])
{
$wikiExists =1;
$wgSitename = $wikiConfig['title'];
$wgMetaNamespace = "Project";
## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://".$wikiConfig['url'];
if($wikiConfig['enableUploads']==true)
{
$wgEnableUploads = true;
$wgUploadDirectory="{$IP}/custom/".$wikiConfig['prefix']."_uploads";
$wgUploadPath = "$wgScriptPath/custom/".$wikiConfig['prefix']."_uploads";
$wgUseImageMagick = true;
}
## Database settings
if(!array_key_exists('dbname',$wikiConfig))
{
$wgDBname = $wikiConfig['prefix']."_wiki";
}
else
{
$wgDBname = $wikiConfig['dbname'];
}
}
}
if($wikiExists ==0)
{
echo "This wiki is not available. Check configuration.";
exit(0);
}