From b9c560f34324745f887eb8bc83ae87723ac3559f Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Sun, 20 Mar 2011 17:54:43 +0000 Subject: [PATCH] Fixed broken by r83023 --- includes/installer/Installer.php | 25 ------------------------- includes/installer/WebInstaller.php | 13 ++++++++++++- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 1ddc237585..f8ab8965b7 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -317,9 +317,6 @@ abstract class Installer { // Having a user with id = 0 safeguards us from DB access via User::loadOptions(). $wgUser = User::newFromId( 0 ); - // Set our custom hook. - $wgHooks['ParserFirstCallInit'][] = array( $this, 'registerDocLink' ); - $this->settings = $this->internalDefaults; foreach ( $this->defaultVarNames as $var ) { @@ -1141,18 +1138,6 @@ abstract class Installer { return false; } - /** - * Register tag hook below. - * - * @todo Move this to WebInstaller with the two things below? - * - * @param $parser Parser - */ - public function registerDocLink( Parser &$parser ) { - $parser->setHook( 'doclink', array( $this, 'docLink' ) ); - return true; - } - /** * ParserOptions are constructed before we determined the language, so fix it */ @@ -1161,16 +1146,6 @@ abstract class Installer { $this->parserOptions->setUserLang( $lang->getCode() ); } - /** - * Extension tag hook for a documentation link. - */ - public function docLink( $linkText, $attribs, $parser ) { - $url = $this->getDocUrl( $attribs['href'] ); - return '' . - htmlspecialchars( $linkText ) . - ''; - } - /** * Overridden by WebInstaller to provide lastPage parameters. */ diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 8405a624dd..add4e895d3 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -115,9 +115,10 @@ class WebInstaller extends Installer { $this->output = new WebInstallerOutput( $this ); $this->request = $request; - // Add parser hook for WebInstaller_Complete + // Add parser hooks global $wgParser; $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) ); + $wgParser->setHook( 'doclink', array( $this, 'docLink' ) ); } /** @@ -993,6 +994,16 @@ class WebInstaller extends Installer { return $url; } + /** + * Extension tag hook for a documentation link. + */ + public function docLink( $linkText, $attribs, $parser ) { + $url = $this->getDocUrl( $attribs['href'] ); + return '' . + htmlspecialchars( $linkText ) . + ''; + } + /** * Helper for "Download LocalSettings" link on WebInstall_Complete * @return String Html for download link -- 2.20.1