Skip to content

Commit

Permalink
Merge pull request #3 from SemanticMediaWiki/release
Browse files Browse the repository at this point in the history
1.3.0 release
  • Loading branch information
toniher committed Nov 30, 2015
2 parents 4691e40 + 4542e83 commit 068b033
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 23 deletions.
28 changes: 28 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
filter:
excluded_paths:
- 'vendor/*'

tools:
php_mess_detector:
config:
controversial_rules: { superglobals: false }
php_cpd: true
php_pdepend: true
php_code_coverage: false
php_code_sniffer: true
php_cs_fixer: true
php_loc: true
php_analyzer: true
sensiolabs_security_checker: true
external_code_coverage:
timeout: '900'

checks:
php:
psr2_class_declaration: false
psr2_switch_declaration: false
sql_injection_vulnerabilities: true
security_vulnerabilities: true
no_eval: true
code_rating: true
duplication: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ The recommended way to install Semantic Forms Select is by using [Composer][comp
```json
{
"require": {
"mediawiki/semantic-forms-select": "~1.2"
"mediawiki/semantic-forms-select": "~1.3"
}
}
```
1. From your MediaWiki installation directory, execute
`composer require mediawiki/semantic-forms-select:~1.2`
`composer require mediawiki/semantic-forms-select:~1.3`
2. Navigate to _Special:Version_ on your wiki and verify that the package
have been successfully installed.

Expand Down
10 changes: 10 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This file contains the RELEASE-NOTES of the Semantic Forms Select (a.k.a. SFS) extension.

### 1.3.0 (2015-11-??)

* Added the `SFS` PHP namespace
* Added full Composer compatibility and autoloading (PSR-4)
* Added stricter control over how the `scriptSelect.js` is being used (removed JS elements from PHP) and accessed from MediaWiki
* Added `ResourceLoader` support
* Added unit tests and general test coverage support
* Fixed parser call from `Special:FormEdit/DemoAjax1`
36 changes: 16 additions & 20 deletions SemanticFormsSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
return 1;
}

define( 'SFS_VERSION', '1.3.0-alpha' );
define( 'SFS_VERSION', '1.3.0' );

//self executing anonymous function to prevent global scope assumptions
/**
* @codeCoverageIgnore
*/
call_user_func( function() {

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

//$wgAjaxExportList[] = "QueryExecution";
//$wgAjaxExportList[] = "FunctionExecution";
$GLOBALS['wgExtensionFunctions'][] = function() {
$GLOBALS['sfgFormPrinter']->setInputTypeHook( 'SF_Select', '\SFS\SemanticFormsSelect::init', array() );
};

$GLOBALS['wgAutoloadClasses']['SFS\SemanticFormsSelect'] = __DIR__ . '/src/SemanticFormsSelect.php';
$GLOBALS['wgAutoloadClasses']['SFS\ApiSemanticFormsSelect'] = __DIR__ . '/src/ApiSemanticFormsSelect.php';
$GLOBALS['wgAutoloadClasses']['SFS\ApiRequestProcessor'] = __DIR__ . '/src/ApiRequestProcessor.php';
$GLOBALS['wgAutoloadClasses']['SFS\Output'] = __DIR__ . '/src/Output.php';

// api modules
// Api modules
$GLOBALS['wgAPIModules']['sformsselect'] = 'SFS\ApiSemanticFormsSelect';

$GLOBALS['wgSF_SelectDir'] = dirname(__FILE__) ;
$GLOBALS['wgSF_SelectScriptPath'] = $GLOBALS['wgScriptPath'] . '/extensions/'.basename($GLOBALS['wgSF_SelectDir']);

$GLOBALS['wgScriptSelectCount'] = 0;
$GLOBALS['wgSF_Select_debug'] = 0;

// Register resource files
$extensionPathParts = explode( DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR , __DIR__, 2 );

$GLOBALS['wgResourceModules']['ext.sf_select.scriptselect'] = array(
'localBasePath' => $GLOBALS['wgSF_SelectDir'],
'remoteExtPath' => 'SemanticFormsSelect',
'localBasePath' => __DIR__ ,
'remoteExtPath' => end( $extensionPathParts ),
'position' => 'bottom',
'scripts' => array( 'res/scriptSelect.js' ),
'dependencies' => array(
'ext.semanticforms.main'
)
);

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

} );
2 changes: 1 addition & 1 deletion src/SemanticFormsSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static function init( $value, $inputName, $isMandatory, $isDisabled, $oth
}

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

$selectField = array();
$values = null;
Expand Down

0 comments on commit 068b033

Please sign in to comment.