-
Notifications
You must be signed in to change notification settings - Fork 1
/
WikidataRepo.php
55 lines (45 loc) · 2.6 KB
/
WikidataRepo.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
<?php
// safeguard ---------------------------------------------------------
if ( !defined( 'MEDIAWIKI' ) ) {
echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
die( 1 );
}
// credits ---------------------------------------------------------
$WikidataRepoVersion = 0.1;
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'WikidataRepo',
'author' => 'Daniel Kinzler for Hallo Welt Medienwerkstatt',
'url' => 'http://mediawiki.org/wiki/Extension:WikidataRepo',
'descriptionmsg' => 'wikidatarepo-desc',
'version' => $WikidataRepoVersion,
);
// register resources ---------------------------------------------------------
$dir = dirname( __FILE__ ) . '/';
$wgExtensionMessagesFiles['WikidataRepo'] = $dir . 'WikidataRepo.i18n.php';
$wgResourceModules['ext.WikidataRepo'] = array(
// JavaScript and CSS styles. To combine multiple file, just list them as an array.
'scripts' => 'WikidataRepo.js',
'styles' => 'WikidataRepo.css',
// When your module is loaded, these messages will be available to mediaWiki.msg()
//'messages' => array( 'myextension-hello-world', 'myextension-goodbye-world' ),
// If your scripts need code from other modules, list their identifiers as dependencies
// and ResourceLoader will make sure they're loaded before you.
// You don't need to manually list 'mediawiki' or 'jquery', which are always loaded.
//'dependencies' => array( 'jquery.ui.datepicker' ),
// ResourceLoader needs to know where your files are; specify your
// subdir relative to "extensions" or $wgExtensionAssetsPath
'localBasePath' => 'WikidataRepo',
'remoteExtPath' => 'WikidataRepo',
);
// register classes ---------------------------------------------------------
$wgAutoloadClasses['WikidataContentHandler'] = $dir . 'WikidataContentHandler.php';
$wgAutoloadClasses['WikidataDifferenceEngine'] = $dir . 'WikidataContentHandler.php';
$wgAutoloadClasses['WikidataContent'] = $dir . 'WikidataContent.php';
$wgAutoloadClasses['ApiQueryWikidataProp'] = $dir . 'ApiQueryWikidataProp.php';
// register hooks and handlers ---------------------------------------------------------
define('CONTENT_MODEL_WIKIDATA', 'wikidata');
$wgContentHandlers[CONTENT_MODEL_WIKIDATA] = 'WikidataContentHandler';
$wgAPIPropModules['wikidata'] = 'ApiQueryWikidataProp';
// configuration defaults ---------------------------------------------------------
$wgWikidataSerialisationFormat = 'application/json'; # alternative: application/vnd.php.serialized