Yurik has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/326046 )
Change subject: Enable structured data in production ...................................................................... Enable structured data in production Bug: T148745 Change-Id: I670e20bc9a26ffd19e182b85673d30e1e1c3d6d5 --- M wmf-config/CommonSettings-labs.php M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings-labs.php M wmf-config/InitialiseSettings.php 4 files changed, 82 insertions(+), 70 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/46/326046/1 diff --git a/wmf-config/CommonSettings-labs.php b/wmf-config/CommonSettings-labs.php index 61ed16d..496152f 100644 --- a/wmf-config/CommonSettings-labs.php +++ b/wmf-config/CommonSettings-labs.php @@ -167,69 +167,13 @@ // Enable Tabular data namespace on Commons - T148745 -if ( $wmgEnableTabularData ) { - // Safety: before extension.json, these values were initialized by JsonConfig.php - if ( !isset( $wgJsonConfigModels ) ) { - $wgJsonConfigModels = []; - } - if ( !isset( $wgJsonConfigs ) ) { - $wgJsonConfigs = []; - } - // https://www.mediawiki.org/wiki/Extension:JsonConfig#Configuration - $wgJsonConfigModels['Tabular.JsonConfig'] = 'JsonConfig\JCTabularContent'; - $wgJsonConfigs['Tabular.JsonConfig'] = [ - 'namespace' => 486, - 'nsName' => 'Data', - // page name must end in ".tab", and contain at least one symbol - 'pattern' => '/.\.tab$/', - 'license' => 'CC0-1.0+', - 'isLocal' => false, - ]; - if ( $wgDBname == 'commonswiki' ) { - // Ensure we have a stable cross-wiki title resolution - // See JCSingleton::parseTitle() - $wgJsonConfigInterwikiPrefix = "meta"; - $wgJsonConfigs['Tabular.JsonConfig']['store'] = true; - } else { - $wgJsonConfigInterwikiPrefix = "commons"; - $wgJsonConfigs['Tabular.JsonConfig']['remote'] = [ - 'url' => 'https://commons.wikimedia.beta.wmflabs.org/w/api.php' - ]; - } - $wgJsonConfigEnableLuaSupport = true; +if ( $wmgEnableTabularData && $wgDBname !== 'commonswiki' ) { + $wgJsonConfigs['Tabular.JsonConfig']['remote']['url'] = 'https://commons.wikimedia.beta.wmflabs.org/w/api.php'; } // Enable Map (GeoJSON) data namespace on Commons - T149548 -if ( $wmgEnableMapData ) { - // Safety: before extension.json, these values were initialized by JsonConfig.php - if ( !isset( $wgJsonConfigModels ) ) { - $wgJsonConfigModels = []; - } - if ( !isset( $wgJsonConfigs ) ) { - $wgJsonConfigs = []; - } - // https://www.mediawiki.org/wiki/Extension:JsonConfig#Configuration - $wgJsonConfigModels['Map.JsonConfig'] = 'JsonConfig\JCMapDataContent'; - $wgJsonConfigs['Map.JsonConfig'] = [ - 'namespace' => 486, - 'nsName' => 'Data', - // page name must end in ".map", and contain at least one symbol - 'pattern' => '/.\.map$/', - 'license' => 'CC0-1.0+', - 'isLocal' => false, - ]; - if ( $wgDBname == 'commonswiki' ) { - // Ensure we have a stable cross-wiki title resolution - // See JCSingleton::parseTitle() - $wgJsonConfigInterwikiPrefix = "meta"; - $wgJsonConfigs['Map.JsonConfig']['store'] = true; - } else { - $wgJsonConfigInterwikiPrefix = "commons"; - $wgJsonConfigs['Map.JsonConfig']['remote'] = [ - 'url' => 'https://commons.wikimedia.beta.wmflabs.org/w/api.php' - ]; - } - $wgJsonConfigEnableLuaSupport = true; +if ( $wmgEnableMapData && $wgDBname !== 'commonswiki' ) { + $wgJsonConfigs['Map.JsonConfig']['remote']['url'] = 'https://commons.wikimedia.beta.wmflabs.org/w/api.php'; } diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index 2cd9d9e..3efcb3e 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -3104,6 +3104,74 @@ $wgUsersNotifiedOnAllChanges[] = 'Yurik'; } +// Enable Tabular data namespace on Commons - T148745 +// TODO: $wmgEnableMapData and $wmgEnableTabularData should probably be merged into one +if ( $wmgEnableTabularData ) { + // Safety: before extension.json, these values were initialized by JsonConfig.php + if ( !isset( $wgJsonConfigModels ) ) { + $wgJsonConfigModels = []; + } + if ( !isset( $wgJsonConfigs ) ) { + $wgJsonConfigs = []; + } + // https://www.mediawiki.org/wiki/Extension:JsonConfig#Configuration + $wgJsonConfigModels['Tabular.JsonConfig'] = 'JsonConfig\JCTabularContent'; + $wgJsonConfigs['Tabular.JsonConfig'] = [ + 'namespace' => 486, + 'nsName' => 'Data', + // page name must end in ".tab", and contain at least one symbol + 'pattern' => '/.\.tab$/', + 'license' => 'CC0-1.0+', + 'isLocal' => false, + ]; + if ( $wgDBname === 'commonswiki' ) { + // Ensure we have a stable cross-wiki title resolution + // See JCSingleton::parseTitle() + $wgJsonConfigInterwikiPrefix = "meta"; + $wgJsonConfigs['Tabular.JsonConfig']['store'] = true; + } else { + $wgJsonConfigInterwikiPrefix = "commons"; + $wgJsonConfigs['Tabular.JsonConfig']['remote'] = [ + 'url' => 'https://commons.wikimedia.org/w/api.php' + ]; + } + $wgJsonConfigEnableLuaSupport = true; +} + +// Enable Map (GeoJSON) data namespace on Commons - T149548 +// TODO: $wmgEnableMapData and $wmgEnableTabularData should probably be merged into one +if ( $wmgEnableMapData ) { + // Safety: before extension.json, these values were initialized by JsonConfig.php + if ( !isset( $wgJsonConfigModels ) ) { + $wgJsonConfigModels = []; + } + if ( !isset( $wgJsonConfigs ) ) { + $wgJsonConfigs = []; + } + // https://www.mediawiki.org/wiki/Extension:JsonConfig#Configuration + $wgJsonConfigModels['Map.JsonConfig'] = 'JsonConfig\JCMapDataContent'; + $wgJsonConfigs['Map.JsonConfig'] = [ + 'namespace' => 486, + 'nsName' => 'Data', + // page name must end in ".map", and contain at least one symbol + 'pattern' => '/.\.map$/', + 'license' => 'CC0-1.0+', + 'isLocal' => false, + ]; + if ( $wgDBname === 'commonswiki' ) { + // Ensure we have a stable cross-wiki title resolution + // See JCSingleton::parseTitle() + $wgJsonConfigInterwikiPrefix = "meta"; + $wgJsonConfigs['Map.JsonConfig']['store'] = true; + } else { + $wgJsonConfigInterwikiPrefix = "commons"; + $wgJsonConfigs['Map.JsonConfig']['remote'] = [ + 'url' => 'https://commons.wikimedia.org/w/api.php' + ]; + } + $wgJsonConfigEnableLuaSupport = true; +} + if ( $wmgUseGraph ) { wfLoadExtension( 'Graph' ); diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index b8111ee..2130cf5 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -565,16 +565,6 @@ ], ], - // Enable Tabular data namespace on Commons - T148745 - 'wmgEnableTabularData' => [ - 'default' => true, - ], - - // Enable Map (GeoJSON) data namespace on Commons - T149548 - 'wmgEnableMapData' => [ - 'default' => true, - ], - 'wmgUsePageViewInfo' => [ 'default' => true, ], diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index fcc753a..ba9bcd7 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14508,6 +14508,16 @@ 'zerowiki' => true, ], +// Enable Tabular data namespace on Commons - T148745 +'wmgEnableTabularData' => [ + 'default' => true, +], + +// Enable Map (GeoJSON) data namespace on Commons - T149548 +'wmgEnableMapData' => [ + 'default' => true, +], + 'wmgUseGraph' => [ 'default' => true, ], -- To view, visit https://gerrit.wikimedia.org/r/326046 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I670e20bc9a26ffd19e182b85673d30e1e1c3d6d5 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Yurik <yu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits