-
Notifications
You must be signed in to change notification settings - Fork 1
/
SemanticImageCaption.php
63 lines (49 loc) · 1.26 KB
/
SemanticImageCaption.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
<?php
use SMW\ImageCaption\Hooks;
/**
* Complementary extension to Semantic MediaWiki to support auto-caption of
* images.
*
* @see https://github.com/SemanticMediaWiki/SemanticImageCaption
*
* @defgroup SemanticImageCaption Semantic ImageCaption
*/
SemanticImageCaption::load();
/**
* @codeCoverageIgnore
*/
class SemanticImageCaption {
/**
* @since 1.0
*
* @note It is expected that this function is loaded before LocalSettings.php
* to ensure that settings and global functions are available by the time
* the extension is activated.
*/
public static function load() {
if ( !defined( 'MEDIAWIKI' ) ) {
return;
}
if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
include_once __DIR__ . '/vendor/autoload.php';
}
}
/**
* @since 1.0
* @see https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#callback
*/
public static function initExtension( $credits = [] ) {
$version = 'UNKNOWN' ;
// See https://phabricator.wikimedia.org/T151136
if ( isset( $credits['version'] ) ) {
$version = $credits['version'];
}
define( 'SMW_IMAGECAPTION_VERSION', $version );
$GLOBALS['wgMessagesDirs']['SemanticImageCaption'] = __DIR__ . '/i18n';
}
/**
* @since 1.0
*/
public static function onExtensionFunction() {
}
}