Refactor Blankpage to subclass SpecialPage like a normal special page. :)
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 19 Jun 2009 23:46:33 +0000 (23:46 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 19 Jun 2009 23:46:33 +0000 (23:46 +0000)
includes/AutoLoader.php
includes/SpecialPage.php
includes/specials/SpecialBlankpage.php

index b1552de..ce86237 100644 (file)
@@ -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',
index 2e8bd86..9a2cdaf 100644 (file)
@@ -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' ),
index 29d6b96..d2b86fc 100644 (file)
@@ -1,6 +1,16 @@
 <?php
-
-function wfSpecialBlankpage() {
-       global $wgOut;
-       $wgOut->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');
+       }
 }