Dereckson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/314748

Change subject: Switch to extension registration for Mobile extensions
......................................................................

Switch to extension registration for Mobile extensions

Bug: T147234
Change-Id: I3b7063965f57f82c48bf262c7522321f235d3cb0
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
M wmf-config/mobile.php
3 files changed, 48 insertions(+), 76 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/48/314748/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index f6f5bb1..67f33df 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3004,13 +3004,13 @@
        $wgAbuseFilterIsCentral = ( $wgDBname === $wgAbuseFilterCentralDB );
 }
 
-if ( $wmgZeroPortal || $wmgUseGraph ) {
-       require_once( "$IP/extensions/JsonConfig/JsonConfig.php" );
+if ( $wmgZeroPortal || $wmgUseGraph || $wmgZeroBanner ) {
+       wfLoadExtension( 'JsonConfig' );
 }
 
 if ( $wmgZeroPortal ) {
-       require_once( "$IP/extensions/ZeroBanner/ZeroBanner.php" );
-       require_once( "$IP/extensions/ZeroPortal/ZeroPortal.php" );
+       wfLoadExtension( 'ZeroBanner' );
+       wfLoadExtension( 'ZeroPortal' );
 
        // zerowiki treats all logged-in users the same as anonymous, without 
giving them any extra rights
        // Only sysops and scripts get additional rights on zerowiki
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index e8c1233..91e5867 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -14308,12 +14308,12 @@
 'wmgMobileFrontend' => [
        'default' => true,
 ],
-'wmgMFQueryPropModules' => [
+'wgMFQueryPropModules' => [
        // workaround for T125672
        'default' => [ 'pageprops' ],
        'wikidata' => [ 'pageterms' ],
 ],
-'wmgMFSearchAPIParams' => [
+'wgMFSearchAPIParams' => [
        // workaround for T125672, though also fixes T120197
        'default' => [
                'ppprop' => 'displaytitle'
@@ -14322,7 +14322,7 @@
                'wbptterms' => 'label'
        ]
 ],
-'wmgMFSearchGenerator' => [
+'wgMFSearchGenerator' => [
        'default' => [
                'name' => 'prefixsearch',
                'prefix' => 'ps'
@@ -14411,7 +14411,7 @@
        'commonswiki' => true,
 ],
 
-'wmgMobileFrontendLogo' => [
+'wgMobileFrontendLogo' => [
        'default' => '/static/images/mobile/wikimedia.png',
        'commonswiki' => '/static/images/mobile/commons.png',
        'mediawikiwiki' => '/static/images/mobile/mediawiki.png',
@@ -14428,7 +14428,7 @@
        'wiktionary' => '/static/images/mobile/wiktionary.png',
 ],
 
-'wmgMobileUrlTemplate' => [
+'wgMobileUrlTemplate' => [
        'default' => '%h0.m.%h1.%h2',
        'foundationwiki' => 'm.%h0.%h1',
        'mediawikiwiki' => 'm.%h1.%h2',
@@ -14436,12 +14436,12 @@
        'wikidatawiki' => 'm.%h1.%h2',
        'wikitech' => '', // Not behind Varnish so no black magick
 ],
-'wmgMFAutodetectMobileView' => [
+'wgMFAutodetectMobileView' => [
        'default' => false,
        'wikitech' => true, // Not behind Varnish
 ],
 
-'wmgMFCustomLogos' => [
+'wgMFCustomLogos' => [
        'default' => [],
        'enwiki' => [
                'copyright' => 
'/static/images/mobile/wikipedia-wordmark-en.png',
@@ -14454,53 +14454,65 @@
                'copyright-height' => 15,
        ],
 ],
-'wmgMFEnableDesktopResources' => [
+
+// Enable loading of desktop-specific resources from MobileFrontend
+'wgMFEnableDesktopResources' => [
        'default' => true,
 ],
-'wmgMFPhotoUploadEndpoint' => [
+
+'wgMFPhotoUploadEndpoint' => [
        'default' => '//commons.m.wikimedia.org/w/api.php',
        'commonswiki' => '', // T47256
        'test2wiki' => '',
        'private' => '',
        'fishbowl' => '',
 ],
-'wmgMFContentNamespace' => [
+'wgMFContentNamespace' => [
        'default' => NS_MAIN,
        'commonswiki' => NS_FILE,
 ],
-'wmgMFNearby' => [
+'wgMFNearby' => [
        'default' => true, // Does not gets enabled on wikis w/o GeoData anyway
 ],
-'wmgMFPhotoUploadWiki' => [
+'wgMFPhotoUploadWiki' => [
        'default' => 'commonswiki',
        'test2wiki' => '',
 ],
-'wmgMFEnableXAnalyticsLogging' => [
+
+// Enable X-Analytics logging
+'wgMFEnableXAnalyticsLogging' => [
        'default' => true,
 ],
+
 'wgMinervaEnableSiteNotice' => [
        'default' => false,
 ],
-'wmgMFAppPackageId' => [
+
+// Link to help Google spider associate pages on wiki with our Android app.
+// They originally special-cased us but would like it done the normal way now. 
:)
+'wgMFAppPackageId' => [
        'default' => false,
        'wikipedia' => 'org.wikipedia',
 ],
 
-# trademark status
-'wmgMFTrademarkSitename' => [
+// Enable appending of TM (text) / (R) (icon) on site name in footer.
+'wgMFTrademarkSitename' => [
        'default' => 'registered',
        'wikidatawiki' => 'unregistered',
        'metawiki' => false, // T43141
 ],
-'wmgMFNoMobileCategory' => [
+
+// Blacklist some pages
+'wgMFNoMobileCategory' => [
        'default' => false,
        'foundationwiki' => 'Desktop-only_pages',
 ],
-'wmgMFNoMobilePages' => [
+'wgMFNoMobilePages' => [
        'default' => [],
        'foundationwiki' => [ 'Special:FundraiserStatistics' ],
 ],
-'wmgMFCollapseSectionsByDefault' => [
+
+'wgMFCollapseSectionsByDefault' => [
        'default' => true,
        'wiktionary' => false,
        'wikidata' => false,
@@ -14527,7 +14539,7 @@
 'wgMinervaUseFooterV2' => [
        'default' => true,
 ],
-'wmgMFMobileFormatterHeadings' => [
+'wgMFMobileFormatterHeadings' => [
        'default' => [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],
        'wikivoyage' => [ 'h2', 'h3', 'h4', 'h5', 'h6' ], // T110436, T110837
 ],
@@ -14570,9 +14582,11 @@
        'default' => true,
 ],
 
-// Formerly known as $wgMFAnonymousEditing
-'wmgMFEditorOptions' => [
-       'default' => [ 'anonymousEditing' => true, ], // T93210
+// Enable editing for unregistered users
+'wgMFEditorOptions' => [
+       'default' => [
+               'anonymousEditing' => true, // T93210
+       ],
        'kowiki' => false, // T94388
 ],
 
diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php
index 7a84ddd..46f299a 100644
--- a/wmf-config/mobile.php
+++ b/wmf-config/mobile.php
@@ -4,35 +4,20 @@
 # # Do not put private data here.
 
 if ( $wmgMobileFrontend ) {
-       require_once( "$IP/extensions/MobileFrontend/MobileFrontend.php" );
+       wfLoadExtension( 'MobileFrontend' );
+
        $wgMFMobileHeader = 'X-Subdomain';
        $wgMFNoindexPages = false;
-       $wgMFNearby = $wmgMFNearby && $wmgEnableGeoData;
-       $wgMFPhotoUploadEndpoint = $wmgMFPhotoUploadEndpoint;
-       $wgMFPhotoUploadWiki = $wmgMFPhotoUploadWiki;
-       $wgMFContentNamespace = $wmgMFContentNamespace;
-       $wgMFMobileFormatterHeadings = $wmgMFMobileFormatterHeadings;
-
-       if ( $wmgMobileFrontendLogo ) {
-               $wgMobileFrontendLogo = $wmgMobileFrontendLogo;
-       }
-       if ( $wmgMFCustomLogos ) {
-               if ( isset( $wmgMFCustomLogos['copyright'] ) ) {
-                       $wmgMFCustomLogos['copyright'] = str_replace( 
'{wgExtensionAssetsPath}', $wgExtensionAssetsPath, 
$wmgMFCustomLogos['copyright'] );
-               }
-               $wgMFCustomLogos = $wmgMFCustomLogos;
+       if ( !$wmgEnableGeoData ) {
+               $wgMFNearby = false;
        }
 
-       // If a URL template is set for MobileFrontend, use it.
-       if ( $wmgMobileUrlTemplate ) {
-               $wgMobileUrlTemplate = $wmgMobileUrlTemplate;
+       if ( isset( $wgMFCustomLogos['copyright'] ) ) {
+               $wgMFCustomLogos['copyright'] = str_replace( 
'{wgExtensionAssetsPath}', $wgExtensionAssetsPath, 
$wgMFCustomLogos['copyright'] );
        }
-
-       $wgMFAutodetectMobileView = $wmgMFAutodetectMobileView;
 
        if ( $wmgZeroBanner && !$wmgZeroPortal ) {
-               require_once( "$IP/extensions/JsonConfig/JsonConfig.php" );
-               require_once( "$IP/extensions/ZeroBanner/ZeroBanner.php" );
+               wfLoadExtension( 'ZeroBanner' );
 
                $wgJsonConfigs['JsonZeroConfig']['isLocal'] = false;
                $wgJsonConfigs['JsonZeroConfig']['remote'] = [
@@ -46,21 +31,6 @@
                // $wgZeroBannerFont = 
'/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf';
                // $wgZeroBannerFontSize = '10';
        }
-
-       // Enable loading of desktop-specific resources from MobileFrontend
-       if ( $wmgMFEnableDesktopResources ) {
-               $wgMFEnableDesktopResources = true;
-       }
-
-       // Enable appending of TM (text) / (R) (icon) on site name in footer.
-       $wgMFTrademarkSitename = $wmgMFTrademarkSitename;
-
-       // Enable X-Analytics logging
-       $wgMFEnableXAnalyticsLogging = $wmgMFEnableXAnalyticsLogging;
-
-       // Blacklist some pages
-       $wgMFNoMobileCategory = $wmgMFNoMobileCategory;
-       $wgMFNoMobilePages = $wmgMFNoMobilePages;
 
        $wgHooks['EnterMobileMode'][] = function() {
                global $wgCentralAuthCookieDomain, $wgHooks, 
$wgIncludeLegacyJavaScript;
@@ -89,22 +59,10 @@
                return true;
        };
 
-       $wgMFCollapseSectionsByDefault = $wmgMFCollapseSectionsByDefault;
        $wgMFTidyMobileViewSections = false; // experimental
-
-       // Link to help Google spider associate pages on wiki with our Android 
app.
-       // They originally special-cased us but would like it done the normal 
way now. :)
-       $wgMFAppPackageId = $wmgMFAppPackageId;
        $wgMFNearbyRange = $wgMaxGeoSearchRadius;
 
        $wgMFEnableBeta = true;
-
-       // enable editing for unregistered users
-       $wgMFEditorOptions = $wmgMFEditorOptions;
-
-       $wgMFQueryPropModules = $wmgMFQueryPropModules;
-       $wgMFSearchAPIParams = $wmgMFSearchAPIParams;
-       $wgMFSearchGenerator = $wmgMFSearchGenerator;
 
        // Turn on volunteer recruitment
        $wgMFEnableJSConsoleRecruitment = true;

-- 
To view, visit https://gerrit.wikimedia.org/r/314748
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b7063965f57f82c48bf262c7522321f235d3cb0
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson <dereck...@espace-win.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to