1 | <?php |
||
11 | class SemanticFormsSelect { |
||
|
|||
12 | |||
13 | /** |
||
14 | * @since 1.0 |
||
15 | */ |
||
16 | public static function initExtension( $credits = array() ) { |
||
17 | |||
18 | // See https://phabricator.wikimedia.org/T151136 (extension.json) |
||
19 | define( 'SFS_VERSION', isset( $credits['version'] ) ? $credits['version'] : '2.2.0-alpha' ); |
||
20 | |||
21 | // Api modules |
||
22 | $GLOBALS['wgAPIModules']['sformsselect'] = 'SFS\ApiSemanticFormsSelect'; |
||
23 | |||
24 | $GLOBALS['wgScriptSelectCount'] = 0; |
||
25 | $GLOBALS['wgSF_Select_debug'] = 0; |
||
26 | |||
27 | // Register resource files |
||
28 | $GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array( |
||
29 | 'localBasePath' => __DIR__ , |
||
30 | 'remoteExtPath' => 'SemanticFormsSelect', |
||
31 | 'position' => 'bottom', |
||
32 | 'scripts' => array( |
||
33 | 'res/scriptSelect.js' |
||
34 | ), |
||
35 | 'dependencies' => array( |
||
36 | 'ext.pageforms.main' |
||
37 | ) |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @since 1.0 |
||
43 | */ |
||
44 | public static function onExtensionFunction() { |
||
54 | |||
55 | /** |
||
56 | * @since 1.0 |
||
57 | * |
||
58 | * @param string $dependency |
||
59 | * |
||
60 | * @return string|null |
||
61 | */ |
||
62 | public static function getVersion( $dependency = null ) { |
||
74 | |||
75 | } |
||
76 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.