@@ -5,11 +5,11 @@ discard block |
||
5 | 5 | * |
6 | 6 | * @defgroup SemanticCompoundQueries SemanticCompoundQueries |
7 | 7 | */ |
8 | -if ( !defined( 'MEDIAWIKI' ) ) { |
|
9 | - die( 'This file is part of the Semantic Compound Queries extension, it is not a valid entry point.' ); |
|
8 | +if (!defined('MEDIAWIKI')) { |
|
9 | + die('This file is part of the Semantic Compound Queries extension, it is not a valid entry point.'); |
|
10 | 10 | } |
11 | 11 | |
12 | -if ( defined( 'SCQ_VERSION' ) ) { |
|
12 | +if (defined('SCQ_VERSION')) { |
|
13 | 13 | // Do not initialize more than once. |
14 | 14 | return 1; |
15 | 15 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function load() { |
32 | 32 | |
33 | - if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) { |
|
33 | + if (is_readable(__DIR__ . '/vendor/autoload.php')) { |
|
34 | 34 | include_once __DIR__ . '/vendor/autoload.php'; |
35 | 35 | } |
36 | 36 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function initExtension() { |
58 | 58 | |
59 | - define( 'SCQ_VERSION', '1.2.0-alpha' ); |
|
59 | + define('SCQ_VERSION', '1.2.0-alpha'); |
|
60 | 60 | |
61 | 61 | // Register the extension |
62 | 62 | $GLOBALS['wgExtensionCredits']['semantic'][] = [ |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public static function checkRequirements() { |
88 | 88 | |
89 | - if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.27', 'lt' ) ) { |
|
90 | - die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.' ); |
|
89 | + if (version_compare($GLOBALS['wgVersion'], '1.27', 'lt')) { |
|
90 | + die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.'); |
|
91 | 91 | } |
92 | 92 | |
93 | - if ( !defined( 'SMW_VERSION' ) ) { |
|
94 | - die( '<b>Error:</b> <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> requires the <a href="https://github.com/SemanticMediaWiki/SemanticMediaWiki/">Semantic MediaWiki</a> extension. Please enable or install the extension first.' ); |
|
93 | + if (!defined('SMW_VERSION')) { |
|
94 | + die('<b>Error:</b> <a href="https://github.com/SemanticMediaWiki/SemanticCompoundQueries/">Semantic Compound Queries</a> requires the <a href="https://github.com/SemanticMediaWiki/SemanticMediaWiki/">Semantic MediaWiki</a> extension. Please enable or install the extension first.'); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | // wgAPIModules |
109 | 109 | $GLOBALS['wgAPIModules']['compoundquery'] = 'SCQ\Api\CompoundQuery'; |
110 | 110 | |
111 | - $GLOBALS['wgHooks']['ParserFirstCallInit'][] = function( Parser &$parser ) { |
|
112 | - $parser->setFunctionHook( 'compound_query', [ '\SCQ\CompoundQueryProcessor', 'doCompoundQuery' ] ); |
|
111 | + $GLOBALS['wgHooks']['ParserFirstCallInit'][] = function(Parser &$parser) { |
|
112 | + $parser->setFunctionHook('compound_query', ['\SCQ\CompoundQueryProcessor', 'doCompoundQuery']); |
|
113 | 113 | |
114 | 114 | // always return true, in order not to stop MW's hook processing! |
115 | 115 | return true; |