Skip to content

Commit

Permalink
Merge pull request #472 from JeroenDeDauw/rel601
Browse files Browse the repository at this point in the history
6.0.1 release
  • Loading branch information
JeroenDeDauw authored Sep 5, 2018
2 parents f60344d + 4fe1a39 commit 828448c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 23 deletions.
14 changes: 5 additions & 9 deletions MapsRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,27 @@
class MapsRegistration {

public static function onRegistration( array $credits ) {
if ( defined( 'Maps_COORDS_FLOAT' ) ) {
if ( defined( 'Maps_VERSION' ) ) {
// Do not initialize more than once.
return true;
}

if ( !defined( 'Maps_SETTINGS_LOADED' ) ) {
require_once __DIR__ . '/Maps_Settings.php';
}

if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
include_once( __DIR__ . '/vendor/autoload.php' );
}

define( 'Maps_VERSION', $credits['version'] );
define( 'SM_VERSION', Maps_VERSION );

// The different coordinate notations.
define( 'Maps_COORDS_FLOAT', 'float' );
define( 'Maps_COORDS_DMS', 'dms' );
define( 'Maps_COORDS_DM', 'dm' );
define( 'Maps_COORDS_DD', 'dd' );

if ( !(bool)'Defining PHP constants in JSON is a bad idea and breaks tools' ) {
define( 'NS_GEO_JSON', 420 );
define( 'NS_GEO_JSON_TALK', 421 );
}

require_once __DIR__ . '/Maps_Settings.php';

// Internationalization
$GLOBALS['wgMessagesDirs']['Maps.class'] = __DIR__ . '/i18n';
$GLOBALS['wgExtensionMessagesFiles']['MapsMagic'] = __DIR__ . '/Maps.i18n.magic.php';
Expand Down
24 changes: 14 additions & 10 deletions Maps_Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

// Boolean. Sets if geocoded addresses should be stored in a cache.
$GLOBALS['egMapsEnableGeoCache'] = true;

// Integer. If egMapsEnableGeoCache is true, determines the TTL of cached geocoded addresses.
// Default value: 1 day.
$GLOBALS['egMapsGeoCacheTtl'] = 24 * 3600;
Expand All @@ -66,22 +67,22 @@

// The coordinate notations that should be available.
$GLOBALS['egMapsAvailableCoordNotations'] = [
Maps_COORDS_FLOAT,
Maps_COORDS_DMS,
Maps_COORDS_DM,
Maps_COORDS_DD
'float',
'dms',
'dm',
'dd'
];

// Enum. The default output format of coordinates.
// Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD
$GLOBALS['egMapsCoordinateNotation'] = Maps_COORDS_DMS;
// The default output format of coordinates.
// Possible values: float, dms, dm, dd
$GLOBALS['egMapsCoordinateNotation'] = 'dms';

# Enum. The default output format of coordinates when displayed by Semantic MediaWiki.
# Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD
# The default output format of coordinates when displayed by Semantic MediaWiki.
# Possible values: float, dms, dm, dd
$GLOBALS['smgQPCoodFormat'] = $GLOBALS['egMapsCoordinateNotation'];

// Boolean. Indicates if coordinates should be outputted in directional notation by default.
// Recommended to be true for Maps_COORDS_DMS and false for Maps_COORDS_FLOAT.
// Recommended to be true for dms and false for float.
$GLOBALS['egMapsCoordinateDirectional'] = true;

# Boolean. Indicates if coordinates should be outputted in directional notation by default when
Expand Down Expand Up @@ -413,3 +414,6 @@

$GLOBALS['egMapsGlobalJSVars'] = [];

if ( !defined( 'Maps_SETTINGS_LOADED' ) ) {
define( 'Maps_SETTINGS_LOADED', true );
}
10 changes: 9 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ different releases and which versions of PHP and MediaWiki they support, see the
[platform compatibility tables](INSTALL.md#platform-compatibility-and-release-status).


## Maps 6.0.1

Released on September 5th, 2018.

* Fixed loading of default settings

## Maps 6.0.0

Released on September 4th, 2018.
Expand All @@ -21,7 +27,9 @@ Released on September 4th, 2018.
### Breaking changes

* Maps is no longer automatically loaded when it is installed with Composer. You now need to call `wfLoadExtension( 'Maps' )`
(preferred) or include the entry point (`require_once __DIR__ . '/extensions/Maps/Maps.php';`) in `LocalSettings.php`
(preferred) or include the entry point (`require_once __DIR__ . '/extensions/Maps/Maps.php';`) in `LocalSettings.php`.
You will also need to include the default settings before your modify the Maps settings
`require_once __DIR__ . '/extensions/Maps/Maps_Settings.php';`
* Removed unused `egMapsNamespaceIndex` setting

## Maps 5.6.0
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Maps",
"version": "6.0",
"version": "6.0.1",

"author": [
"[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]",
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/parserhooks/CoordinatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function processingProvider() {
$expected = [
'location' => new LatLongValue( 4, 2 ),
'directional' => !$definitions['directional']->getDefault(),
'format' => Maps_COORDS_DD,
'format' => 'dd',
];

$argLists[] = [ $values, $expected ];
Expand All @@ -106,7 +106,7 @@ public function processingProvider() {
$expected = [
'location' => new LatLongValue( 4, 2 ),
'directional' => !$definitions['directional']->getDefault(),
'format' => Maps_COORDS_DD,
'format' => 'dd',
];

$argLists[] = [ $values, $expected ];
Expand Down

0 comments on commit 828448c

Please sign in to comment.