-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCreateWiki.php
68 lines (57 loc) · 2.6 KB
/
CreateWiki.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
65
66
67
68
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
exit( 1 );
}
/**
* // Example configuration
* // These should be set before the extension is loaded......
*
* $wgCreateWikiPublicDbListLocation = "/srv/foo/dblist.public";
* $wgCreateWikiPrivateDbListLocation = "/srv/foo/dblist.private";
* $wgCreateWikiBaseDomain = 'orain.org'
* $wgCreateWikiUseCloudFlare = true;
* $wgCloudFlareUser = 'foo';
* $wgCloudFlareKey = 'bar';
*/
// Hack function to throw Exception on bad config
function efCreateWikiExceptionOnBadConfig() {
global $wgCreateWikiBaseDomain;
if( !is_string( $wgCreateWikiBaseDomain ) ) {
throw new MWException( 'CreateWiki must have $wgCreateWikiBaseDomain set' );
}
}
$wgExtensionCredits['specialpage'][] = array(
'author' => 'Southparkfan, Kudu & Addshore',
'descriptionmsg' => 'createwiki-desc',
'name' => 'CreateWiki',
'path' => __FILE__,
'url' => '//github.com/Orain/CreateWiki'
);
$wgAutoloadClasses['cloudflare_api'] = __DIR__ . '/lib/class_cloudflare.php';
$wgAutoloadClasses['SpecialCreateWiki'] = __DIR__ . '/SpecialCreateWiki.php';
$wgAutoloadClasses['CreateWikiHooks'] = __DIR__ . '/CreateWiki.hooks.php';
$wgAutoloadClasses['CreateWikiLogFormatter'] = __DIR__ . '/CreateWikiLogFormatter.php';
$wgAutoloadClasses['RequestWikiQueuePager'] = __DIR__ . '/RequestWikiQueuePager.php';
$wgAutoloadClasses['SpecialRequestWiki'] = __DIR__ . '/SpecialRequestWiki.php';
$wgAutoloadClasses['SpecialRequestWikiQueue'] = __DIR__ . '/SpecialRequestWikiQueue.php';
$wgExtensionMessagesFiles['CreateWiki'] = dirname( __FILE__ ) . '/CreateWiki.i18n.php';
$wgMessagesDirs['CreateWiki'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['CreateWikiAlias'] = __DIR__ . '/CreateWiki.alias.php';
$wgSpecialPages['CreateWiki'] = 'SpecialCreateWiki';
$wgSpecialPages['RequestWiki'] = 'SpecialRequestWiki';
$wgSpecialPages['RequestWikiQueue'] = 'SpecialRequestWikiQueue';
$wgHooks['LoadExtensionSchemaUpdates'][] = 'CreateWikiHooks::fnCreateWikiSchemaUpdates';
$wgAvailableRights[] = 'createwiki';
$wgLogTypes[] = 'farmer';
$wgLogActionsHandlers['farmer/createwiki'] = 'LogFormatter';
$wgLogActionsHandlers['farmer/requestwiki'] = 'CreateWikiLogFormatter';
/**
* SQL files to be sourced into the created databases.
*/
$wgCreateWikiSQLfiles = array(
'maintenance/tables.sql' => "$IP/maintenance/tables.sql",
'AbuseFilter/abusefilter.tables.sql' => "$IP/extensions/AbuseFilter/abusefilter.tables.sql",
'AntiSpoof/sql/patch-antispoof.mysql.sql' => "$IP/extensions/AntiSpoof/sql/patch-antispoof.mysql.sql",
'CheckUser/cu_log.sql' => "$IP/extensions/CheckUser/cu_log.sql",
'CheckUser/cu_changes.sql' => "$IP/extensions/CheckUser/cu_changes.sql",
);