-
Notifications
You must be signed in to change notification settings - Fork 0
/
Offline.php
57 lines (47 loc) · 1.67 KB
/
Offline.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
<?php
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'Wikipedia Offline Patch',
'author' => 'Adam Wight',
'status' => 'beta',
'url' => 'http://code.google.com/p/wikipedia-offline-patch',
'version' => '0.6.1',
'descriptionmsg' => 'offline_desc'
);
$dir = dirname(__FILE__);
$wgExtensionMessagesFiles['Offline'] = $dir.'/Offline.i18n.php';
$wgExtensionAliasesFiles['Offline'] = $dir.'/Offline.aliases.php';
$wgExtensionFunctions[] = 'wfOfflineInit';
$wgSpecialPages['Offline'] = 'SpecialOffline';
$wgSpecialPageGroups['Offline'] = 'wiki'; // XXX is not the key?
$wgAutoloadClasses['DatabaseBz2'] = $dir.'/DatabaseBz2.php';
$wgAutoloadClasses['SearchBz2'] = $dir.'/SearchBz2.php';
$wgAutoloadClasses['SpecialOffline'] = $dir.'/SpecialOffline.php';
function wfOfflineInit() {
global $wgDBservers, $wgOfflineWikiPath;
// TODO -> mediawiki:
if ( !$wgDBservers ) {
global $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, $wgDBtype, $wgDebugDumpSql;
$wgDBservers = array(array(
'host' => $wgDBserver,
'user' => $wgDBuser,
'password' => $wgDBpassword,
'dbname' => $wgDBname,
'type' => $wgDBtype,
'load' => 1,
'flags' => ($wgDebugDumpSql ? DBO_DEBUG : 0) | DBO_DEFAULT
));
}
// Our dump fetch is installed as the fallback to existing dbs.
// Dump reader will be called through a very single-minded sql api.
//$wgDBservers[] = array( // fixme: you can only do this if your primary db will successfully connect().
$wgDBservers[] = array(
'dbname' => $wgOfflineWikiPath,
'type' => 'bz2',
'load' => 1,
'host' => false,
'user' => false,
'flags' => false,
'password' => false,
);
}