From 0fafc4512ef05e23722fdf6c3d643fd6235cd7e2 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 19 Jun 2009 23:46:33 +0000 Subject: [PATCH] Refactor Blankpage to subclass SpecialPage like a normal special page. :) --- includes/AutoLoader.php | 1 + includes/SpecialPage.php | 2 +- includes/specials/SpecialBlankpage.php | 18 ++++++++++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index b1552de392..ce86237d3f 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -493,6 +493,7 @@ $wgAutoloadLocalClasses = array( 'RevisionDeleter' => 'includes/specials/SpecialRevisiondelete.php', 'ShortPagesPage' => 'includes/specials/SpecialShortpages.php', 'SpecialAllpages' => 'includes/specials/SpecialAllpages.php', + 'SpecialBlankpage' => 'includes/specials/SpecialBlankpage.php', 'SpecialBookSources' => 'includes/specials/SpecialBooksources.php', 'SpecialExport' => 'includes/specials/SpecialExport.php', 'SpecialImport' => 'includes/specials/SpecialImport.php', diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 2e8bd86582..9a2cdaf511 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -174,7 +174,7 @@ class SpecialPage 'Booksources' => 'SpecialBookSources', # Unlisted / redirects - 'Blankpage' => array( 'UnlistedSpecialPage', 'Blankpage' ), + 'Blankpage' => 'SpecialBlankpage', 'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ), 'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ), 'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ), diff --git a/includes/specials/SpecialBlankpage.php b/includes/specials/SpecialBlankpage.php index 29d6b96c7a..d2b86fc99b 100644 --- a/includes/specials/SpecialBlankpage.php +++ b/includes/specials/SpecialBlankpage.php @@ -1,6 +1,16 @@ addWikiMsg('intentionallyblankpage'); +/** + * Special page designed for basic benchmarking of + * MediaWiki since it doesn't really do much. + * + * @ingroup SpecialPage + */ +class SpecialBlankpage extends UnlistedSpecialPage { + public function __construct() { + parent::__construct( 'Blankpage' ); + } + public function execute( $par ) { + global $wgOut; + $wgOut->addWikiMsg('intentionallyblankpage'); + } } -- 2.20.1