Skip to content

Commit 068b033

Browse files
committed
Merge pull request #3 from SemanticMediaWiki/release
1.3.0 release
2 parents 4691e40 + 4542e83 commit 068b033

File tree

5 files changed

+57
-23
lines changed

5 files changed

+57
-23
lines changed

.scrutinizer.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
filter:
2+
excluded_paths:
3+
- 'vendor/*'
4+
5+
tools:
6+
php_mess_detector:
7+
config:
8+
controversial_rules: { superglobals: false }
9+
php_cpd: true
10+
php_pdepend: true
11+
php_code_coverage: false
12+
php_code_sniffer: true
13+
php_cs_fixer: true
14+
php_loc: true
15+
php_analyzer: true
16+
sensiolabs_security_checker: true
17+
external_code_coverage:
18+
timeout: '900'
19+
20+
checks:
21+
php:
22+
psr2_class_declaration: false
23+
psr2_switch_declaration: false
24+
sql_injection_vulnerabilities: true
25+
security_vulnerabilities: true
26+
no_eval: true
27+
code_rating: true
28+
duplication: true

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ The recommended way to install Semantic Forms Select is by using [Composer][comp
2323
```json
2424
{
2525
"require": {
26-
"mediawiki/semantic-forms-select": "~1.2"
26+
"mediawiki/semantic-forms-select": "~1.3"
2727
}
2828
}
2929
```
3030
1. From your MediaWiki installation directory, execute
31-
`composer require mediawiki/semantic-forms-select:~1.2`
31+
`composer require mediawiki/semantic-forms-select:~1.3`
3232
2. Navigate to _Special:Version_ on your wiki and verify that the package
3333
have been successfully installed.
3434

RELEASE-NOTES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
This file contains the RELEASE-NOTES of the Semantic Forms Select (a.k.a. SFS) extension.
2+
3+
### 1.3.0 (2015-11-??)
4+
5+
* Added the `SFS` PHP namespace
6+
* Added full Composer compatibility and autoloading (PSR-4)
7+
* Added stricter control over how the `scriptSelect.js` is being used (removed JS elements from PHP) and accessed from MediaWiki
8+
* Added `ResourceLoader` support
9+
* Added unit tests and general test coverage support
10+
* Fixed parser call from `Special:FormEdit/DemoAjax1`

SemanticFormsSelect.php

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
return 1;
2424
}
2525

26-
define( 'SFS_VERSION', '1.3.0-alpha' );
26+
define( 'SFS_VERSION', '1.3.0' );
2727

28-
//self executing anonymous function to prevent global scope assumptions
28+
/**
29+
* @codeCoverageIgnore
30+
*/
2931
call_user_func( function() {
3032

31-
$GLOBALS['wgExtensionCredits'][defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'specialpage'][] = array(
33+
$GLOBALS['wgExtensionCredits']['semantic'][] = array(
3234
'path' => __FILE__,
3335
'name' => 'Semantic Forms Select',
3436
'author' =>array( 'Jason Zhang', 'Toni Hermoso Pulido', '...' ),
@@ -38,33 +40,27 @@
3840
'license-name' => 'GPL-2.0+',
3941
);
4042

41-
//$wgAjaxExportList[] = "QueryExecution";
42-
//$wgAjaxExportList[] = "FunctionExecution";
43-
$GLOBALS['wgExtensionFunctions'][] = function() {
44-
$GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() );
45-
};
46-
47-
$GLOBALS['wgAutoloadClasses']['SFS\SemanticFormsSelect'] = __DIR__ . '/src/SemanticFormsSelect.php';
48-
$GLOBALS['wgAutoloadClasses']['SFS\ApiSemanticFormsSelect'] = __DIR__ . '/src/ApiSemanticFormsSelect.php';
49-
$GLOBALS['wgAutoloadClasses']['SFS\ApiRequestProcessor'] = __DIR__ . '/src/ApiRequestProcessor.php';
50-
$GLOBALS['wgAutoloadClasses']['SFS\Output'] = __DIR__ . '/src/Output.php';
51-
52-
// api modules
43+
// Api modules
5344
$GLOBALS['wgAPIModules']['sformsselect'] = 'SFS\ApiSemanticFormsSelect';
5445

55-
$GLOBALS['wgSF_SelectDir'] = dirname(__FILE__) ;
56-
$GLOBALS['wgSF_SelectScriptPath'] = $GLOBALS['wgScriptPath'] . '/extensions/'.basename($GLOBALS['wgSF_SelectDir']);
57-
5846
$GLOBALS['wgScriptSelectCount'] = 0;
5947
$GLOBALS['wgSF_Select_debug'] = 0;
6048

49+
// Register resource files
50+
$extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 );
51+
6152
$GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array(
62-
'localBasePath' => $GLOBALS['wgSF_SelectDir'],
63-
'remoteExtPath' => 'SemanticFormsSelect',
53+
'localBasePath' => __DIR__ ,
54+
'remoteExtPath' => end( $extensionPathParts ),
55+
'position' => 'bottom',
6456
'scripts' => array( 'res/scriptSelect.js' ),
6557
'dependencies' => array(
6658
'ext.semanticforms.main'
6759
)
6860
);
6961

62+
$GLOBALS['wgExtensionFunctions'][] = function() {
63+
$GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() );
64+
};
65+
7066
} );

src/SemanticFormsSelect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function init( $value, $inputName, $isMandatory, $isDisabled, $oth
4848
}
4949

5050
public function select ( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) {
51-
global $wgScriptPath,$wgSF_SelectDir, $wgScriptSelectCount, $sfgFieldNum, $wgUser,$wgSF_SelectScriptPath;
51+
global $wgScriptSelectCount, $sfgFieldNum, $wgUser;
5252

5353
$selectField = array();
5454
$values = null;

0 commit comments

Comments
 (0)