Skip to content

Commit 828448c

Browse files
authored
Merge pull request #472 from JeroenDeDauw/rel601
6.0.1 release
2 parents f60344d + 4fe1a39 commit 828448c

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

MapsRegistration.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,27 @@
55
class MapsRegistration {
66

77
public static function onRegistration( array $credits ) {
8-
if ( defined( 'Maps_COORDS_FLOAT' ) ) {
8+
if ( defined( 'Maps_VERSION' ) ) {
99
// Do not initialize more than once.
1010
return true;
1111
}
1212

13+
if ( !defined( 'Maps_SETTINGS_LOADED' ) ) {
14+
require_once __DIR__ . '/Maps_Settings.php';
15+
}
16+
1317
if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
1418
include_once( __DIR__ . '/vendor/autoload.php' );
1519
}
1620

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

20-
// The different coordinate notations.
21-
define( 'Maps_COORDS_FLOAT', 'float' );
22-
define( 'Maps_COORDS_DMS', 'dms' );
23-
define( 'Maps_COORDS_DM', 'dm' );
24-
define( 'Maps_COORDS_DD', 'dd' );
25-
2624
if ( !(bool)'Defining PHP constants in JSON is a bad idea and breaks tools' ) {
2725
define( 'NS_GEO_JSON', 420 );
2826
define( 'NS_GEO_JSON_TALK', 421 );
2927
}
3028

31-
require_once __DIR__ . '/Maps_Settings.php';
32-
3329
// Internationalization
3430
$GLOBALS['wgMessagesDirs']['Maps.class'] = __DIR__ . '/i18n';
3531
$GLOBALS['wgExtensionMessagesFiles']['MapsMagic'] = __DIR__ . '/Maps.i18n.magic.php';

Maps_Settings.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
// Boolean. Sets if geocoded addresses should be stored in a cache.
5959
$GLOBALS['egMapsEnableGeoCache'] = true;
60+
6061
// Integer. If egMapsEnableGeoCache is true, determines the TTL of cached geocoded addresses.
6162
// Default value: 1 day.
6263
$GLOBALS['egMapsGeoCacheTtl'] = 24 * 3600;
@@ -66,22 +67,22 @@
6667

6768
// The coordinate notations that should be available.
6869
$GLOBALS['egMapsAvailableCoordNotations'] = [
69-
Maps_COORDS_FLOAT,
70-
Maps_COORDS_DMS,
71-
Maps_COORDS_DM,
72-
Maps_COORDS_DD
70+
'float',
71+
'dms',
72+
'dm',
73+
'dd'
7374
];
7475

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

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

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

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

414415
$GLOBALS['egMapsGlobalJSVars'] = [];
415416

417+
if ( !defined( 'Maps_SETTINGS_LOADED' ) ) {
418+
define( 'Maps_SETTINGS_LOADED', true );
419+
}

RELEASE-NOTES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ different releases and which versions of PHP and MediaWiki they support, see the
33
[platform compatibility tables](INSTALL.md#platform-compatibility-and-release-status).
44

55

6+
## Maps 6.0.1
7+
8+
Released on September 5th, 2018.
9+
10+
* Fixed loading of default settings
11+
612
## Maps 6.0.0
713

814
Released on September 4th, 2018.
@@ -21,7 +27,9 @@ Released on September 4th, 2018.
2127
### Breaking changes
2228

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

2735
## Maps 5.6.0

extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Maps",
3-
"version": "6.0",
3+
"version": "6.0.1",
44

55
"author": [
66
"[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]",

tests/Integration/parserhooks/CoordinatesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function processingProvider() {
9292
$expected = [
9393
'location' => new LatLongValue( 4, 2 ),
9494
'directional' => !$definitions['directional']->getDefault(),
95-
'format' => Maps_COORDS_DD,
95+
'format' => 'dd',
9696
];
9797

9898
$argLists[] = [ $values, $expected ];
@@ -106,7 +106,7 @@ public function processingProvider() {
106106
$expected = [
107107
'location' => new LatLongValue( 4, 2 ),
108108
'directional' => !$definitions['directional']->getDefault(),
109-
'format' => Maps_COORDS_DD,
109+
'format' => 'dd',
110110
];
111111

112112
$argLists[] = [ $values, $expected ];

0 commit comments

Comments
 (0)