forked from SemanticMediaWiki/SemanticMediaWiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SemanticMediaWiki.php
83 lines (77 loc) · 2.21 KB
/
SemanticMediaWiki.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* This documentation group collects source code files belonging to Semantic
* MediaWiki.
*
* For documenting extensions of SMW, please do not use groups starting with
* "SMW" but make your own groups instead. Browsing at
* https://doc.semantic-mediawiki.org/ is assumed to be easier this way.
*
* @defgroup SMW Semantic MediaWiki
*/
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'Not an entry point.' );
}
if ( defined( 'SMW_VERSION' ) ) {
// Do not load SMW more than once
return 1;
}
if ( version_compare( $GLOBALS['wgVersion'], '1.23c', '<' ) ) {
die( '<b>Error:</b> This version of Semantic MediaWiki requires MediaWiki 1.23 or above.' );
}
/**
* THIS IS A TEMPORARY HACK to get around the #1699 issue in connection with the
* tarball release that conflicts with the Composer autoloading when invoked
* via the LocalSettings.
*
* By the time `extension.json` is used, the content from load.php is to be moved
* into this file.
*/
require_once __DIR__ . "/load.php";
/**
* `extension.json` should only be introduced by the time:
*
* - A major SMW release change (e.g. 3.x) occurs
* - `requires` section in extension.json is supported for extensions
* - MW 1.27 to be a minimum requirement
*
* @note Only remove the SemanticMediaWiki.php from the `files` section in the
* composer.json, any other `files` entry remains to ensure that initial
* settings, aliases are loaded before `wfLoadExtension( 'SemanticMediaWiki' );`
* is invoked.
*
* Furthermore, remove the `require_once` from the SemanticMediaWiki::initExtension
* as those are loaded using Composer.
*
* Expected format:
*
* {
* "name": "Semantic MediaWiki",
* "version": "3.0.0-alpha",
* "author": [
* "..."
* ],
* "url": "https://www.semantic-mediawiki.org",
* "descriptionmsg": "smw-desc",
* "license-name": "GPL-2.0+",
* "type": "semantic",
* "requires": {
* "MediaWiki": ">= 1.27"
* },
* "MessagesDirs": {
* "SemanticMediaWiki": [
* "i18n"
* ]
* },
* "AutoloadClasses": {
* "SemanticMediaWiki": "SemanticMediaWiki.php"
* },
* "callback": "SemanticMediaWiki::initExtension",
* "ExtensionFunctions": [
* "SemanticMediaWiki::onExtensionFunction"
* ],
* "load_composer_autoloader":true,
* "manifest_version": 1
* }
*
*/