From: Timo Tijhof Date: Thu, 18 Jul 2019 00:29:12 +0000 (+0100) Subject: installer: Remove parser function and last use of it X-Git-Tag: 1.34.0-rc.0~965^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=1b60564ce75fc9a50c967eed24ac1cd5ba29acc4;p=lhc%2Fweb%2Fwiklou.git installer: Remove parser function and last use of it Pass the url to the Copying page as a message parameter instead. This results in identical text and styling. Not even "external link" vs plain link styling difference, because that doesn't exist in the installer stylesheet. The message is renamed in this commit because it is a breaking change (due to being removed, and due to $2 being required). Bug: T227297 Change-Id: I73efd9ecb193523a7e384a7a40c768d32b2361b8 --- diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 33c06fedc0..db26c0b63d 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -145,10 +145,6 @@ class WebInstaller extends Installer { parent::__construct(); $this->output = new WebInstallerOutput( $this ); $this->request = $request; - - // Add parser hooks - $parser = MediaWikiServices::getInstance()->getParser(); - $parser->setHook( 'doclink', [ $this, 'docLink' ] ); } /** @@ -1090,7 +1086,7 @@ class WebInstaller extends Installer { } /** - * Helper for Installer::docLink() + * Helper for WebInstallerOutput * * @internal For use by WebInstallerOutput * @param string $page @@ -1106,21 +1102,6 @@ class WebInstaller extends Installer { return $this->getUrl( $query ); } - /** - * Extension tag hook for a documentation link. - * - * @param string $linkText - * @param string[] $attribs - * @param Parser $parser Unused - * - * @return string - */ - public function docLink( $linkText, $attribs, $parser ) { - $url = $this->getDocUrl( $attribs['href'] ); - - return Html::element( 'a', [ 'href' => $url ], $linkText ); - } - /** * Helper for sidebar links. * diff --git a/includes/installer/WebInstallerWelcome.php b/includes/installer/WebInstallerWelcome.php index 28e8784701..662a40ded2 100644 --- a/includes/installer/WebInstallerWelcome.php +++ b/includes/installer/WebInstallerWelcome.php @@ -33,8 +33,12 @@ class WebInstallerWelcome extends WebInstallerPage { if ( $status->isGood() ) { $this->parent->output->addHTML( '' . wfMessage( 'config-env-good' )->escaped() . '' ); - $this->parent->output->addWikiTextAsInterface( wfMessage( 'config-copyright', - SpecialVersion::getCopyrightAndAuthorList() )->plain() ); + $this->parent->output->addWikiTextAsInterface( + wfMessage( 'config-welcome-section-copyright', + SpecialVersion::getCopyrightAndAuthorList(), + wfExpandUrl( $this->parent->getDocUrl( 'Copying' ) ) + )->plain() + ); $this->startForm(); $this->endForm(); } else { diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json index 5f5e452ab0..52d8d3db80 100644 --- a/includes/installer/i18n/en.json +++ b/includes/installer/i18n/en.json @@ -39,7 +39,7 @@ "config-help-restart": "Do you want to clear all saved data that you have entered and restart the installation process?", "config-restart": "Yes, restart it", "config-welcome": "=== Environmental checks ===\nBasic checks will now be performed to see if this environment is suitable for MediaWiki installation.\nRemember to include this information if you seek support on how to complete the installation.", - "config-copyright": "=== Copyright and Terms ===\n\n$1\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.\nSee the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA, or [https://www.gnu.org/copyleft/gpl.html read it online].", + "config-welcome-section-copyright": "=== Copyright and Terms ===\n\n$1\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.\nSee the GNU General Public License for more details.\n\nYou should have received [$2 a copy of the GNU General Public License] along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA, or [https://www.gnu.org/copyleft/gpl.html read it online].", "config-sidebar": "* [https://www.mediawiki.org MediaWiki home]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Administrator's Guide]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]", "config-sidebar-readme": "Read me", "config-sidebar-relnotes": "Release notes", diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json index 6a821b8cff..a1e6dd6e39 100644 --- a/includes/installer/i18n/qqq.json +++ b/includes/installer/i18n/qqq.json @@ -63,7 +63,7 @@ "config-help-restart": "Message in warning box in MediaWiki installer.", "config-restart": "Button text to confirm the installation procedure has to be restarted.", "config-welcome": "Notice that the installer is about to check as to whether MediaWiki can be installed.", - "config-copyright": "This message follows {{msg-mw|config-env-good}}.\n\nParameters:\n* $1 - copyright and author list", + "config-welcome-section-copyright": "This message follows {{msg-mw|config-env-good}}.\n\nParameters:\n* $1 - copyright and author list\n* $2 - Link to the installer page that contains the license text\n", "config-sidebar": "Maximum width for words is 24 characters. Only visible part of the translation counts to this limit.", "config-sidebar-readme": "Link in sidebar to read the README documentation", "config-sidebar-relnotes": "Link in sidebar to read the RELEASE-NOTES documentation",