From 167fbd0a2064cf435e51a91c1b8aa93b1c77fe08 Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Wed, 24 Jan 2024 19:46:04 +0100 Subject: [PATCH] Drop deprecated config $wgLogoHD It has been deprecated since 1.35, hard deprecated since at least I9776d11d4e2d184 No grep result in wmf-config Change-Id: I2c67bab3e3212f25a0cbce7301f5e32a082f76da --- RELEASE-NOTES-1.42 | 1 + docs/config-schema.yaml | 33 ----------------- docs/config-vars.php | 9 ----- includes/MainConfigNames.php | 9 ----- includes/MainConfigSchema.php | 37 ------------------- includes/ResourceLoader/SkinModule.php | 14 +------ includes/config-schema.php | 8 ---- .../ResourceLoader/SkinModuleTest.php | 2 - 8 files changed, 2 insertions(+), 111 deletions(-) diff --git a/RELEASE-NOTES-1.42 b/RELEASE-NOTES-1.42 index 9dc9a3b90db..7d6d90218cd 100644 --- a/RELEASE-NOTES-1.42 +++ b/RELEASE-NOTES-1.42 @@ -46,6 +46,7 @@ For notes on 1.41.x and older releases, see HISTORY. * $wgJobSerialCommitThreshold has been removed without deprecation, it wasn't used anywhere according to codesearch and any setups using this config will perform just fine but might be less performant. +* $wgLogoHD, deprecated since 1.35, has been removed. Use $wgLogo instead. * … === New user-facing features in 1.42 === diff --git a/docs/config-schema.yaml b/docs/config-schema.yaml index 0384f1c8690..fa1b55ce0ad 100644 --- a/docs/config-schema.yaml +++ b/docs/config-schema.yaml @@ -282,39 +282,6 @@ config-schema: Defaults to [ "1x" => $wgLogo ], or [ "1x" => "$wgResourceBasePath/resources/assets/change-your-logo.svg" ] if $wgLogo is not set. @since 1.35 - LogoHD: - default: false - type: - - object - - boolean - deprecated: |- - since 1.35. Developers should retrieve this logo (and other variants) using - the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos. - $wgLogos should be used instead. - description: |- - Array with URL paths to HD versions of the wiki logo. The scaled logo size - should be under 135x155 pixels. - Only 1.5x and 2x versions are supported. - @par Example: - @code - $wgLogoHD = [ - "1.5x" => "path/to/1.5x_version.png", - "2x" => "path/to/2x_version.png" - ]; - @endcode - SVG is also supported but when enabled, it - disables 1.5x and 2x as svg will already - be optimised for screen resolution. - @par Example: - @code - $wgLogoHD = [ - "svg" => "path/to/svg_version.svg", - ]; - @endcode - @since 1.25 - @deprecated since 1.35. Developers should retrieve this logo (and other variants) using - the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos. - $wgLogos should be used instead. Favicon: default: /favicon.ico description: |- diff --git a/docs/config-vars.php b/docs/config-vars.php index 379b17dd257..2a3128ee29f 100644 --- a/docs/config-vars.php +++ b/docs/config-vars.php @@ -168,15 +168,6 @@ $wgLogo = null; */ $wgLogos = null; -/** - * Config variable stub for the LogoHD setting, for use by phpdoc and IDEs. - * @see MediaWiki\MainConfigSchema::LogoHD - * @deprecated since 1.35. Developers should retrieve this logo (and other variants) using - * the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos. - * $wgLogos should be used instead. - */ -$wgLogoHD = null; - /** * Config variable stub for the Favicon setting, for use by phpdoc and IDEs. * @see MediaWiki\MainConfigSchema::Favicon diff --git a/includes/MainConfigNames.php b/includes/MainConfigNames.php index ae4aaf1fc81..6bd615920f1 100644 --- a/includes/MainConfigNames.php +++ b/includes/MainConfigNames.php @@ -183,15 +183,6 @@ class MainConfigNames { */ public const Logos = 'Logos'; - /** - * Name constant for the LogoHD setting, for use with Config::get() - * @see MainConfigSchema::LogoHD - * @deprecated since 1.35. Developers should retrieve this logo (and other variants) using - * the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos. - * $wgLogos should be used instead. - */ - public const LogoHD = 'LogoHD'; - /** * Name constant for the Favicon setting, for use with Config::get() * @see MainConfigSchema::Favicon diff --git a/includes/MainConfigSchema.php b/includes/MainConfigSchema.php index 5767868b22d..dce7c64f194 100644 --- a/includes/MainConfigSchema.php +++ b/includes/MainConfigSchema.php @@ -692,43 +692,6 @@ class MainConfigSchema { 'type' => 'map|false', ]; - /** - * Array with URL paths to HD versions of the wiki logo. The scaled logo size - * should be under 135x155 pixels. - * Only 1.5x and 2x versions are supported. - * - * @par Example: - * @code - * $wgLogoHD = [ - * "1.5x" => "path/to/1.5x_version.png", - * "2x" => "path/to/2x_version.png" - * ]; - * @endcode - * - * SVG is also supported but when enabled, it - * disables 1.5x and 2x as svg will already - * be optimised for screen resolution. - * - * @par Example: - * @code - * $wgLogoHD = [ - * "svg" => "path/to/svg_version.svg", - * ]; - * @endcode - * - * @since 1.25 - * @deprecated since 1.35. Developers should retrieve this logo (and other variants) using - * the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos. - * $wgLogos should be used instead. - */ - public const LogoHD = [ - 'default' => false, - 'type' => 'map|false', - 'deprecated' => 'since 1.35. Developers should retrieve this logo (and other variants) ' . - 'using the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos. $wgLogos ' . - 'should be used instead.', - ]; - /** * The URL path of the icon. * diff --git a/includes/ResourceLoader/SkinModule.php b/includes/ResourceLoader/SkinModule.php index 93e892282d3..212fa6ac6e3 100644 --- a/includes/ResourceLoader/SkinModule.php +++ b/includes/ResourceLoader/SkinModule.php @@ -21,7 +21,6 @@ namespace MediaWiki\ResourceLoader; use InvalidArgumentException; use MediaWiki\Config\Config; -use MediaWiki\Config\ConfigException; use MediaWiki\MainConfigNames; use MediaWiki\Output\OutputPage; use Wikimedia\Minify\CSSMin; @@ -644,7 +643,7 @@ class SkinModule extends LessVarFileModule { $logos = $conf->get( MainConfigNames::Logos ); if ( $logos === false ) { // no logos were defined... this will either - // 1. Load from wgLogo and wgLogoHD + // 1. Load from wgLogo // 2. Trigger runtime exception if those are not defined. $logos = []; } @@ -662,17 +661,6 @@ class SkinModule extends LessVarFileModule { } } - try { - $logoHD = $conf->get( MainConfigNames::LogoHD ); - // make sure not false - if ( $logoHD ) { - // wfDeprecated( __METHOD__ . ' with $wgLogoHD set instead of $wgLogos', '1.35', false, 1 ); - $logos += $logoHD; - } - } catch ( ConfigException $e ) { - // no backwards compatibility changes needed. - } - if ( isset( $logos['wordmark'] ) ) { // Allow skins to scale the wordmark with browser font size (T207789) $logos['wordmark'] = self::getRelativeSizedLogo( $logos['wordmark'] ); diff --git a/includes/config-schema.php b/includes/config-schema.php index 4e7cd775b8e..ad75a3f9153 100644 --- a/includes/config-schema.php +++ b/includes/config-schema.php @@ -34,7 +34,6 @@ return [ 'FileCacheDirectory' => false, 'Logo' => false, 'Logos' => false, - 'LogoHD' => false, 'Favicon' => '/favicon.ico', 'AppleTouchIcon' => false, 'ReferrerPolicy' => false, @@ -2528,10 +2527,6 @@ return [ 0 => 'object', 1 => 'boolean', ], - 'LogoHD' => [ - 0 => 'object', - 1 => 'boolean', - ], 'ReferrerPolicy' => [ 0 => 'array', 1 => 'string', @@ -3239,9 +3234,6 @@ return [ ], ], 'config-schema' => [ - 'LogoHD' => [ - 'deprecated' => 'since 1.35. Developers should retrieve this logo (and other variants) using the static function MediaWiki\\ResourceLoader\\SkinModule::getAvailableLogos. $wgLogos should be used instead.', - ], 'UploadStashScalerBaseUrl' => [ 'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo', ], diff --git a/tests/phpunit/includes/ResourceLoader/SkinModuleTest.php b/tests/phpunit/includes/ResourceLoader/SkinModuleTest.php index 1c84a748f56..bd2a0f7583a 100644 --- a/tests/phpunit/includes/ResourceLoader/SkinModuleTest.php +++ b/tests/phpunit/includes/ResourceLoader/SkinModuleTest.php @@ -263,7 +263,6 @@ class SkinModuleTest extends ResourceLoaderTestCase { $logos = SkinModule::getAvailableLogos( new HashConfig( [ MainConfigNames::Logo => false, MainConfigNames::Logos => false, - MainConfigNames::LogoHD => false, ] ) ); $this->assertSame( [], $logos ); } @@ -400,7 +399,6 @@ class SkinModuleTest extends ResourceLoaderTestCase { MainConfigNames::BaseDirectory => '/dummy', MainConfigNames::ResourceBasePath => '/w', MainConfigNames::Logo => false, - MainConfigNames::LogoHD => false ] + self::getSettings() ) ); $this->assertEquals( [ $result ], $module->getHeaders( $ctx ) );