@@ -6,40 +6,40 @@ discard block |
||
6 | 6 | * |
7 | 7 | * @defgroup SFS SemanticFormsSelect |
8 | 8 | */ |
9 | -if ( !defined( 'MEDIAWIKI' ) ) { |
|
10 | - die( 'This file is part of the SemanticFormsSelect extension, it is not a valid entry point.' ); |
|
9 | +if (!defined('MEDIAWIKI')) { |
|
10 | + die('This file is part of the SemanticFormsSelect extension, it is not a valid entry point.'); |
|
11 | 11 | } |
12 | 12 | |
13 | -if ( file_exists( __DIR__ . '/../../vendor/autoload.php' ) ) { |
|
14 | - require_once( __DIR__ . '/../../vendor/autoload.php' ); |
|
13 | +if (file_exists(__DIR__ . '/../../vendor/autoload.php')) { |
|
14 | + require_once(__DIR__ . '/../../vendor/autoload.php'); |
|
15 | 15 | } |
16 | 16 | |
17 | -if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.23', 'lt' ) ) { |
|
18 | - die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.' ); |
|
17 | +if (version_compare($GLOBALS['wgVersion'], '1.23', 'lt')) { |
|
18 | + die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with MediaWiki 1.23 or above. You need to upgrade MediaWiki first.'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $GLOBALS['wgExtensionFunctions'][] = function() { |
22 | - if ( version_compare( SF_VERSION, '2.8', '<' ) ) { |
|
23 | - die( '<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' ); |
|
22 | + if (version_compare(SF_VERSION, '2.8', '<')) { |
|
23 | + die('<b>Error:</b> This version of <a href="https://github.com/SemanticMediaWiki/SemanticFormsSelect/">SemanticFormsSelect</a> is only compatible with Semantic Forms 2.8 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.'); |
|
24 | 24 | } |
25 | 25 | }; |
26 | 26 | |
27 | 27 | // Do not initialize more than once. |
28 | -if ( defined( 'SFS_VERSION' ) ) { |
|
28 | +if (defined('SFS_VERSION')) { |
|
29 | 29 | return 1; |
30 | 30 | } |
31 | 31 | |
32 | -define( 'SFS_VERSION', '1.3.0' ); |
|
32 | +define('SFS_VERSION', '1.3.0'); |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @codeCoverageIgnore |
36 | 36 | */ |
37 | -call_user_func( function() { |
|
37 | +call_user_func(function() { |
|
38 | 38 | |
39 | 39 | $GLOBALS['wgExtensionCredits']['semantic'][] = array( |
40 | 40 | 'path' => __FILE__, |
41 | 41 | 'name' => 'Semantic Forms Select', |
42 | - 'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ), |
|
42 | + 'author' =>array('Jason Zhang', 'Toni Hermoso Pulido', '...'), |
|
43 | 43 | 'url' => 'https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect', |
44 | 44 | 'description' => 'Allows to generate a select field in a semantic form whose values are retrieved from a query', |
45 | 45 | 'version' => SFS_VERSION, |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | $GLOBALS['wgSF_Select_debug'] = 0; |
54 | 54 | |
55 | 55 | // Register resource files |
56 | - $extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 ); |
|
56 | + $extensionPathParts = explode(DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2); |
|
57 | 57 | |
58 | 58 | $GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array( |
59 | - 'localBasePath' => __DIR__ , |
|
60 | - 'remoteExtPath' => end( $extensionPathParts ), |
|
59 | + 'localBasePath' => __DIR__, |
|
60 | + 'remoteExtPath' => end($extensionPathParts), |
|
61 | 61 | 'position' => 'bottom', |
62 | - 'scripts' => array( 'res/scriptSelect.js' ), |
|
62 | + 'scripts' => array('res/scriptSelect.js'), |
|
63 | 63 | 'dependencies' => array( |
64 | 64 | 'ext.semanticforms.main' |
65 | 65 | ) |
66 | 66 | ); |
67 | 67 | |
68 | 68 | $GLOBALS['wgExtensionFunctions'][] = function() { |
69 | - $GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() ); |
|
69 | + $GLOBALS['sfgFormPrinter']->setInputTypeHook('SF_Select', '\SFS\SemanticFormsSelect::init', array()); |
|
70 | 70 | }; |
71 | 71 | |
72 | 72 | } ); |