-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathWikiSEO.php
71 lines (62 loc) · 2.44 KB
/
WikiSEO.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
<?php
/**
* WikiSEO extension - Allows per page meta settings (keywords, description) and to change the title.
* @version 1.2.1 - 2014/12/11 (based on the work of Vladimir Radulovski and Jim Wilson)
*
* @link https://www.mediawiki.org/wiki/Extension:WikiSEO Documentation
* @link https://www.mediawiki.org/wiki/Extension_talk:WikiSEO Support
* @link https://github.com/tinymighty/wiki-seo/issues Bug tracker
* @link https://github.com/andru/wiki-seo Source Code
*
* @file
* @ingroup Extensions
* @package MediaWiki
* @author Andru Vallance (Andrujhon)
* @copyright (C) 2013 Andru Vallance
* @license https://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
// Confirm MediaWiki environment.
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is a MediaWiki extension and thus not a valid entry point.' );
}
global $wgExtensionMessagesFiles;
if ( function_exists( 'wfLoadExtension' ) ) {
wfLoadExtension( 'WikiSEO' );
// Keep i18n globals so mergeMessageFileList.php doesn't break
$wgExtensionMessagesFiles['WikiSEOMagic'] = __DIR__ . '/WikiSEO.i18n.magic.php';
$wgExtensionMessagesFiles['WikiSEO'] = __DIR__ . '/WikiSEO.i18n.php';
wfWarn(
'Deprecated PHP entry point used for WikiSEO extension. Please use wfLoadExtension instead, ' .
'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
);
return;
} else {
global $wgExtensionCredits, $wgAutoloadClasses, $wgHooks;
// Display extension properties on MediaWiki.
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'WikiSEO',
'author' => array(
'Andru Vallance', '...'
),
'url' => 'https://www.mediawiki.org/wiki/Extension:WikiSEO',
'descriptionmsg' => 'seo-desc',
'license-name' => 'GPL-2.0+',
'version' => '1.2.1'
);
// Register extension class.
$wgAutoloadClasses['WikiSEO'] = __DIR__ . '/WikiSEO.body.php';
// Register extension messages and other localisation.
$wgExtensionMessagesFiles['WikiSEOMagic'] = __DIR__ . '/WikiSEO.i18n.magic.php';
$wgExtensionMessagesFiles['WikiSEO'] = __DIR__ . '/WikiSEO.i18n.php';
//init the parser function & tag extension
$wgHooks['ParserFirstCallInit'][] = 'WikiSEO::init';
//check the wikitext for cached values
$wgHooks['OutputPageBeforeHTML'][] = 'WikiSEO::loadParamsFromWikitext';
//set the tags
$wgHooks['BeforePageDisplay'][] = 'WikiSEO::modifyHTML';
$wgGoogleSiteVerificationKey = null;
$wgFacebookAdmins = null;
$wgFacebookAppID = null;
$wgAddJSONLD = true;
}