Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/288096
Change subject: Convert default and example settings to use short array syntax
......................................................................
Convert default and example settings to use short array syntax
Change-Id: I2cb76918b4ff8ccf681f682ed7a3f79a0954b2d0
---
M client/config/WikibaseClient.default.php
M client/config/WikibaseClient.example.php
M lib/config/WikibaseLib.default.php
M repo/config/Wikibase.default.php
M repo/config/Wikibase.example.php
5 files changed, 63 insertions(+), 63 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/96/288096/1
diff --git a/client/config/WikibaseClient.default.php
b/client/config/WikibaseClient.default.php
index aa6e53b..7233788 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -18,11 +18,11 @@
return call_user_func( function() {
global $wgLanguageCode;
- $defaults = array(
- 'namespaces' => array(), // by default, include all namespaces;
deprecated as of 0.4
- 'excludeNamespaces' => array(),
+ $defaults = [
+ 'namespaces' => [], // by default, include all namespaces;
deprecated as of 0.4
+ 'excludeNamespaces' => [],
'sort' => 'code',
- 'sortPrepend' => array(),
+ 'sortPrepend' => [],
'alwaysSort' => false,
// @todo would be great to just get this from the sites stuff
// but we will need to make sure the caching works good enough
@@ -31,17 +31,17 @@
'injectRecentChanges' => true,
'showExternalRecentChanges' => true,
// default for repo items in main namespace
- 'repoNamespaces' => array(
+ 'repoNamespaces' => [
'wikibase-item' => '',
'wikibase-property' => 'Property'
- ),
+ ],
'allowDataTransclusion' => true,
'propagateChangesToRepo' => true,
'otherProjectsLinksByDefault' => false,
'otherProjectsLinksBeta' => false,
// List of additional CSS class names for site links that have
badges,
// e.g. array( 'Q101' => 'badge-goodarticle' )
- 'badgeClassNames' => array(),
+ 'badgeClassNames' => [],
// Allow accessing data from other items in the parser
functions and via Lua
'allowArbitraryDataAccess' => true,
// Maximum number of full entities that can be accessed on a
page. This does
@@ -86,7 +86,7 @@
* WARNING: Disabling a data type after it is in use is
dangerous
* and might break items.
*/
- 'disabledDataTypes' => array(),
+ 'disabledDataTypes' => [],
// The type of object cache to use. Use CACHE_XXX constants.
// This is both a repo and client setting, and should be set to
the same value in
@@ -102,8 +102,8 @@
*
http://meta.wikimedia.org/w/index.php?title=MediaWiki:Interwiki_config-sorting_order-native-languagename-firstword
(revised)
* and from pywikipedia for alphabetic_sr
*/
- 'interwikiSortOrders' => array(
- 'alphabetic' => array(
+ 'interwikiSortOrders' => [
+ 'alphabetic' => [
'ace', 'kbd', 'af', 'ak', 'als', 'am', 'ang',
'ab', 'ar', 'an', 'arc',
'roa-rup', 'frp', 'as', 'ast', 'gn', 'av',
'ay', 'az', 'azb', 'bm', 'bn', 'bjn',
'zh-min-nan', 'nan', 'map-bms', 'ba', 'be',
'be-x-old', 'bh', 'bcl', 'bi',
@@ -131,7 +131,7 @@
'vls', 'war', 'wo', 'wuu', 'ts', 'yi', 'yo',
'zh-yue', 'diq', 'zea', 'bat-smg',
'zh', 'zh-tw', 'zh-cn'
),
- 'alphabetic_revised' => array(
+ 'alphabetic_revised' => [
'ace', 'kbd', 'af', 'ak', 'als', 'am', 'ang',
'ab', 'ar', 'an', 'arc', 'roa-rup',
'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az',
'azb', 'bjn', 'id', 'ms', 'bm', 'bn',
'zh-min-nan', 'nan', 'map-bms', 'jv', 'su',
'ba', 'min', 'be', 'be-x-old', 'bh',
@@ -157,8 +157,8 @@
'uk', 'ur', 'ug', 'za', 'vec', 'vep', 'vo',
'fiu-vro', 'wa', 'zh-classical', 'vls',
'war', 'wo', 'wuu', 'ts', 'yi', 'yo', 'zh-yue',
'diq', 'zea', 'bat-smg', 'zh',
'zh-tw', 'zh-cn'
- ),
- 'alphabetic_sr' => array(
+ ],
+ 'alphabetic_sr' => [
'ace', 'kbd', 'af', 'ak', 'als', 'am', 'ang',
'ab', 'ar', 'an', 'arc',
'roa-rup', 'frp', 'arz', 'as', 'ast', 'gn',
'av', 'ay', 'az', 'azb', 'bjn', 'id',
'ms', 'bg', 'bm', 'zh-min-nan', 'nan',
'map-bms', 'jv', 'su', 'ba', 'be',
@@ -185,8 +185,8 @@
'tpi', 'chy', 've', 'tr', 'tk', 'tw', 'udm',
'uk', 'ur', 'ug', 'za', 'vec',
'vep', 'vo', 'fiu-vro', 'wa', 'vls', 'war',
'wo', 'wuu', 'ts', 'xmf', 'yi',
'yo', 'diq', 'zea', 'zh', 'zh-tw', 'zh-cn',
'zh-classical', 'zh-yue', 'bat-smg'
- ),
- 'alphabetic_fy' => array(
+ ],
+ 'alphabetic_fy' => [
'aa', 'ab', 'ace', 'af', 'ay', 'ak', 'als',
'am', 'an', 'ang', 'ar', 'arc',
'arz', 'as', 'ast', 'av', 'az', 'azb', 'ba',
'bar', 'bat-smg', 'bcl', 'be', 'be-x-old',
'bg', 'bh', 'bi', 'bjn', 'bm', 'bn', 'bo',
'bpy', 'br', 'bs', 'bug', 'bxr',
@@ -212,9 +212,9 @@
'uz', 've', 'vec', 'vep', 'vi', 'vls', 'vo',
'wa', 'war', 'wo', 'wuu', 'xal',
'xh', 'xmf', 'za', 'zea', 'zh', 'zh-classical',
'zh-cn', 'zh-yue', 'zh-min-nan',
'zh-tw', 'zu'
- ),
- ),
- );
+ ],
+ ],
+ ];
// Some defaults depend on information not available at this time.
// Especially, if the repository may be active on the local wiki, and
diff --git a/client/config/WikibaseClient.example.php
b/client/config/WikibaseClient.example.php
index 922cc2b..6376be3 100644
--- a/client/config/WikibaseClient.example.php
+++ b/client/config/WikibaseClient.example.php
@@ -59,35 +59,35 @@
// If the repo is on the same server, this is not necessary.
// This does not work with database types other than mysql.
if ( false ) {
- $wgLBFactoryConf = array(
+ $wgLBFactoryConf = [
'class' => 'LBFactoryMulti',
// Connect to all databases using the same credentials.
- 'serverTemplate' => array(
+ 'serverTemplate' => [
'dbname' => $wgDBname,
'user' => $wgDBuser,
'password' => $wgDBpassword,
'type' => 'mysql',
'flags' => DBO_DEFAULT | DBO_DEBUG,
- ),
+ ],
// Configure two sections, one for the repo and one for the
client.
// Each section contains only one server.
- 'sectionLoads' => array(
- 'DEFAULT' => array(
+ 'sectionLoads' => [
+ 'DEFAULT' => [
'localhost' => 1,
- ),
- 'repo' => array(
+ ],
+ 'repo' => [
'local1' => 1,
- ),
- ),
+ ],
+ ],
// Map the wiki database names to sections. Database names must
be unique,
// i.e. may not exist in more than one section.
- 'sectionsByDB' => array(
+ 'sectionsByDB' => [
$wgDBname => 'DEFAULT',
'repowiki' => 'repo',
- ),
+ ],
/**
* Map host names to IP addresses to bypass DNS.
@@ -102,15 +102,15 @@
* that is grant access to the wikiuser for each of them.
Failure to do so will make the
* MySQL server refuse access.
*/
- 'hostsByName' => array(
+ 'hostsByName' => [
'localhost' => '127.0.0.1:3306',
'local1' => '127.0.2.1',
'local2' => '127.0.2.2',
'local3' => '127.0.2.3',
- ),
+ ],
// Set up as fake master, because there are no slaves.
- 'masterTemplateOverrides' => array( 'fakeMaster' => true ),
- );
+ 'masterTemplateOverrides' => [ 'fakeMaster' => true ],
+ ];
}
diff --git a/lib/config/WikibaseLib.default.php
b/lib/config/WikibaseLib.default.php
index 7189d48..7cfe4b2 100644
--- a/lib/config/WikibaseLib.default.php
+++ b/lib/config/WikibaseLib.default.php
@@ -17,24 +17,24 @@
*
* @license GPL-2.0+
*/
-return array(
+return [
// whether changes get recorded to wb_changes
'useChangesTable' => true,
- 'siteLinkGroups' => array(
+ 'siteLinkGroups' => [
'wikipedia',
- ),
+ ],
- 'specialSiteLinkGroups' => array(),
+ 'specialSiteLinkGroups' => [],
// local by default. Set to something LBFactory understands.
'changesDatabase' => false,
// list of logical database names of local client wikis.
// may contain mappings from site-id to db-name.
- 'localClientDatabases' => array(),
+ 'localClientDatabases' => [],
- 'changeHandlers' => array(
+ 'changeHandlers' => [
'wikibase-item~add' => ItemChange::class,
'wikibase-property~add' => EntityChange::class,
'wikibase-query~add' => EntityChange::class,
@@ -54,7 +54,7 @@
'wikibase-item~restore' => ItemChange::class,
'wikibase-property~restore' => EntityChange::class,
'wikibase-query~restore' => EntityChange::class,
- ),
+ ],
'maxSerializedEntitySize' => $GLOBALS['wgMaxArticleSize'],
-);
+];
diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php
index 7017484..df2305b 100644
--- a/repo/config/Wikibase.default.php
+++ b/repo/config/Wikibase.default.php
@@ -11,8 +11,8 @@
* @license GPL-2.0+
*/
-return array(
- 'idBlacklist' => array(
+return [
+ 'idBlacklist' => [
1,
23,
42,
@@ -20,23 +20,23 @@
9001,
31337,
720101010,
- ),
+ ],
- 'entityNamespaces' => array(),
+ 'entityNamespaces' => [],
// See StatementGrouperBuilder for an example.
- 'statementSections' => array(),
+ 'statementSections' => [],
// Define constraints for multilingual terms (such as labels,
descriptions and aliases).
- 'multilang-limits' => array(
+ 'multilang-limits' => [
'length' => 250, // length constraint
- ),
+ ],
// URL schemes allowed for URL values. See UrlSchemeValidators for a
full list.
- 'urlSchemes' => array( 'ftp', 'http', 'https', 'irc', 'mailto' ),
+ 'urlSchemes' => [ 'ftp', 'http', 'https', 'irc', 'mailto' ],
// Items allowed to be used as badges pointing to their CSS class names
- 'badgeItems' => array(),
+ 'badgeItems' => [],
// Number of seconds for which data output shall be cached.
// Note: keep that low, because such caches cannot always be purged
easily.
@@ -51,7 +51,7 @@
// This is a whitelist, some formats may not be supported because when
missing
// optional dependencies (e.g. easyRdf).
// The formats are given using logical names as used by
EntityDataSerializationService.
- 'entityDataFormats' => array(
+ 'entityDataFormats' => [
// using the API
'json', // default
'php',
@@ -64,7 +64,7 @@
// hardcoded internal handling
'html',
- ),
+ ],
'dataRightsUrl' => function() {
return $GLOBALS['wgRightsUrl'];
@@ -129,11 +129,11 @@
* WARNING: Disabling a data type after it is in use is dangerous
* and might break items.
*/
- 'disabledDataTypes' => array(),
+ 'disabledDataTypes' => [],
// Special non-canonical languages and their BCP 47 mappings
// Based on: https://meta.wikimedia.org/wiki/Special_language_codes
- 'canonicalLanguageCodes' => array(
+ 'canonicalLanguageCodes' => [
'simple' => 'en-x-simple',
'crh' => 'crh-Latn',
'cbk-zam' => 'cbk-x-zam',
@@ -142,19 +142,19 @@
'roa-tara' => 'it-x-tara',
'de-formal' => 'de-x-formal',
'nl-informal' => 'nl-x-informal',
- ),
+ ],
// List of image property id strings, in order of preference, that
should be considered for
// the "page_image" page property.
- 'preferredPageImagesProperties' => array(),
+ 'preferredPageImagesProperties' => [],
// List of globe-coordinate property id strings, in order of
preference, to consider for
// primary coordinates when extracting coordinates from an entity for
the GeoData extension.
- 'preferredGeoDataProperties' => array(),
+ 'preferredGeoDataProperties' => [],
// Mapping of globe URIs to canonical names, as recognized and used by
GeoData extension
// when indexing and querying for coordinates.
- 'globeUris' => array(
+ 'globeUris' => [
'http://www.wikidata.org/entity/Q2' => 'earth',
'http://www.wikidata.org/entity/Q308' => 'mercury',
'http://www.wikidata.org/entity/Q313' => 'venus',
@@ -182,5 +182,5 @@
'http://www.wikidata.org/entity/Q3332' => 'oberon',
'http://www.wikidata.org/entity/Q3359' => 'triton',
'http://www.wikidata.org/entity/Q339' => 'pluto'
- ),
-);
+ ],
+];
diff --git a/repo/config/Wikibase.example.php b/repo/config/Wikibase.example.php
index 67d84c6..0dfe33e 100644
--- a/repo/config/Wikibase.example.php
+++ b/repo/config/Wikibase.example.php
@@ -52,17 +52,17 @@
// the special group includes all the sites in the
specialSiteLinkGroups,
// grouped together in a 'Pages linked to other sites' section.
- $wgWBRepoSettings['siteLinkGroups'] = array(
+ $wgWBRepoSettings['siteLinkGroups'] = [
'wikipedia',
'wikinews',
'wikiquote',
'wikisource',
'wikivoyage',
'special'
- );
+ ];
// these are the site_group codes as listed in the sites table
- $wgWBRepoSettings['specialSiteLinkGroups'] = array( 'commons',
'wikidata' );
+ $wgWBRepoSettings['specialSiteLinkGroups'] = [ 'commons', 'wikidata' ];
} );
/*
--
To view, visit https://gerrit.wikimedia.org/r/288096
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cb76918b4ff8ccf681f682ed7a3f79a0954b2d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits