Completed
Push — master ( dc1683...3e9aec )
by mw
07:38 queued 05:33
created

SemanticCompoundQueries.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 20 and the first side effect is on line 18.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Initialization file for the SemanticCompoundQueries extension.
4
 *
5
 * @file SemanticCompoundQueries.php
6
 * @ingroup SemanticCompoundQueries
7
 *
8
 * @author Yaron Koren
9
 */
10
11
/**
12
 * This documentation group collects source-code files belonging to
13
 * Semantic Compound Queries.
14
 *
15
 * @defgroup SemanticCompoundQueries SemanticCompoundQueries
16
 */
17
18
if ( !defined( 'MEDIAWIKI' ) ) die();
19
20
define( 'SCQ_VERSION', '1.0.1' );
21
22
$GLOBALS['wgExtensionCredits']['semantic'][] = array(
23
	'path' => __FILE__,
24
	'name' => 'Semantic Compound Queries',
25
	'version' => SCQ_VERSION,
26
	'author' => array( 'Yaron Koren' ),
27
	'url' => 'https://www.mediawiki.org/wiki/Extension:Semantic_Compound_Queries',
28
	'descriptionmsg' => 'semanticcompoundqueries-desc',
29
	'license-name' => 'GPL-2.0+'
30
);
31
32
$GLOBALS['wgMessagesDirs']['SemanticCompoundQueries'] = __DIR__ . '/i18n';
33
$GLOBALS['wgExtensionMessagesFiles']['SemanticCompoundQueriesMagic'] = __DIR__ . '/SemanticCompoundQueries.i18n.magic.php';
34
35
$GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'scqgRegisterParser';
36
37
$GLOBALS['wgAutoloadClasses']['SCQQueryProcessor'] = __DIR__ . '/SCQ_QueryProcessor.php';
38
$GLOBALS['wgAutoloadClasses']['SCQQueryResult'] = __DIR__ . '/SCQ_QueryResult.php';
39
$GLOBALS['wgAutoloadClasses']['SCQCompoundQueryApi'] = __DIR__ . '/SCQ_CompoundQueryApi.php';
40
41
$GLOBALS['wgAPIModules']['compoundquery'] = '\SCQCompoundQueryApi';
42
43
function scqgRegisterParser( Parser &$parser ) {
44
	$parser->setFunctionHook( 'compound_query', array( 'SCQQueryProcessor', 'doCompoundQuery' ) );
45
	return true; // always return true, in order not to stop MW's hook processing!
46
}
47