api: remove duplicate __contruct calls
authorAntoine Musso <hashar@free.fr>
Tue, 29 Jan 2013 08:38:17 +0000 (09:38 +0100)
committerAntoine Musso <hashar@free.fr>
Tue, 29 Jan 2013 08:38:17 +0000 (09:38 +0100)
For historical reasons, all our API class had a dummy __construct which
simply calls their parent constructor.  This patch removes all such
occurences to save out some bytes.

Change-Id: I667955d7821f780fc5ce23823d74dedb1729b9fa

37 files changed:
includes/api/ApiBlock.php
includes/api/ApiComparePages.php
includes/api/ApiDelete.php
includes/api/ApiDisabled.php
includes/api/ApiEditPage.php
includes/api/ApiEmailUser.php
includes/api/ApiExpandTemplates.php
includes/api/ApiFeedContributions.php
includes/api/ApiFeedWatchlist.php
includes/api/ApiFileRevert.php
includes/api/ApiFormatDbg.php
includes/api/ApiFormatDump.php
includes/api/ApiFormatNone.php
includes/api/ApiFormatPhp.php
includes/api/ApiFormatTxt.php
includes/api/ApiFormatWddx.php
includes/api/ApiFormatXml.php
includes/api/ApiHelp.php
includes/api/ApiImport.php
includes/api/ApiLogout.php
includes/api/ApiMove.php
includes/api/ApiOpenSearch.php
includes/api/ApiOptions.php
includes/api/ApiParse.php
includes/api/ApiPatrol.php
includes/api/ApiProtect.php
includes/api/ApiPurge.php
includes/api/ApiQueryDisabled.php
includes/api/ApiRollback.php
includes/api/ApiRsd.php
includes/api/ApiSetNotificationTimestamp.php
includes/api/ApiTokens.php
includes/api/ApiUnblock.php
includes/api/ApiUndelete.php
includes/api/ApiUpload.php
includes/api/ApiUserrights.php
includes/api/ApiWatch.php

index 8f71b16..2e4155a 100644 (file)
  */
 class ApiBlock extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * Blocks the user specified in the parameters for the given expiry, with the
         * given reason, and with all other settings provided in the params. If the block
index 863b70b..6b894c1 100644 (file)
 
 class ApiComparePages extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $params = $this->extractRequestParams();
 
index cfa8035..422524d 100644 (file)
  */
 class ApiDelete extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * Extracts the title, token, and reason from the request parameters and invokes
         * the local delete() function with these as arguments. It does not make use of
index ebcfa01..e5ef3b7 100644 (file)
  */
 class ApiDisabled extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $this->dieUsage( "The \"{$this->getModuleName()}\" module has been disabled.", 'moduledisabled' );
        }
index 74d3e14..f6e0679 100644 (file)
  */
 class ApiEditPage extends ApiBase {
 
-       public function __construct( $query, $moduleName ) {
-               parent::__construct( $query, $moduleName );
-       }
-
        public function execute() {
                $user = $this->getUser();
                $params = $this->extractRequestParams();
index ba8edc0..5a5c572 100644 (file)
  */
 class ApiEmailUser extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $params = $this->extractRequestParams();
 
index f740cf8..826171b 100644 (file)
  */
 class ApiExpandTemplates extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                // Cache may vary on $wgUser because ParserOptions gets data from it
                $this->getMain()->setCacheMode( 'anon-public-user-private' );
index 2f02674..015a992 100644 (file)
  */
 class ApiFeedContributions extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * This module uses a custom feed wrapper printer.
         *
index 7a91641..a3b4682 100644 (file)
  */
 class ApiFeedWatchlist extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * This module uses a custom feed wrapper printer.
         *
index 1e463e5..91ab499 100644 (file)
@@ -37,10 +37,6 @@ class ApiFileRevert extends ApiBase {
 
        protected $params;
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $this->params = $this->extractRequestParams();
                // Extract the file and archiveName from the request parameters
index f280a29..1b2e02c 100644 (file)
  */
 class ApiFormatDbg extends ApiFormatBase {
 
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-       }
-
        public function getMimeType() {
                // This looks like it should be text/plain, but IE7 is so
                // brain-damaged it tries to parse text/plain as HTML if it
index db66083..62253e1 100644 (file)
  */
 class ApiFormatDump extends ApiFormatBase {
 
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-       }
-
        public function getMimeType() {
                // This looks like it should be text/plain, but IE7 is so
                // brain-damaged it tries to parse text/plain as HTML if it
index bee1ac9..78023af 100644 (file)
  */
 class ApiFormatNone extends ApiFormatBase {
 
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-       }
-
        public function getMimeType() {
                return 'text/plain';
        }
index 99a047a..b2d1f04 100644 (file)
  */
 class ApiFormatPhp extends ApiFormatBase {
 
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-       }
-
        public function getMimeType() {
                return 'application/vnd.php.serialized';
        }
index 3e1f592..4130e70 100644 (file)
  */
 class ApiFormatTxt extends ApiFormatBase {
 
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-       }
-
        public function getMimeType() {
                // This looks like it should be text/plain, but IE7 is so
                // brain-damaged it tries to parse text/plain as HTML if it
index fd1b327..62b69bb 100644 (file)
  */
 class ApiFormatWddx extends ApiFormatBase {
 
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-       }
-
        public function getMimeType() {
                return 'text/xml';
        }
index 8dbeae4..6ad7ccd 100644 (file)
@@ -36,10 +36,6 @@ class ApiFormatXml extends ApiFormatBase {
        private $mIncludeNamespace = false;
        private $mXslt = null;
 
-       public function __construct( $main, $format ) {
-               parent::__construct( $main, $format );
-       }
-
        public function getMimeType() {
                return 'text/xml';
        }
index 28bb2e9..86f8112 100644 (file)
  */
 class ApiHelp extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * Module for displaying help
         */
index f5636bd..9657e12 100644 (file)
  */
 class ApiImport extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $user = $this->getUser();
                $params = $this->extractRequestParams();
index 00dd625..2ba92a6 100644 (file)
  */
 class ApiLogout extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $user = $this->getUser();
                $oldName = $user->getName();
index bbf4089..3f54fee 100644 (file)
  */
 class ApiMove extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $user = $this->getUser();
                $params = $this->extractRequestParams();
index 6403bd6..caf361a 100644 (file)
  */
 class ApiOpenSearch extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function getCustomPrinter() {
                return $this->getMain()->createPrinterByName( 'json' );
        }
index eff05de..faebcdc 100644 (file)
  */
 class ApiOptions extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * Changes preferences of the current user.
         */
index e86c91c..1e9e503 100644 (file)
@@ -36,10 +36,6 @@ class ApiParse extends ApiBase {
        /** @var Content $pstContent */
        private $pstContent = null;
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                // The data is hot but user-dependent, like page views, so we set vary cookies
                $this->getMain()->setCacheMode( 'anon-public-user-private' );
index 336068f..4d4fbba 100644 (file)
  */
 class ApiPatrol extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * Patrols the article or provides the reason the patrol failed.
         */
index fa6da52..95fdbce 100644 (file)
  */
 class ApiProtect extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                global $wgRestrictionLevels;
                $params = $this->extractRequestParams();
index e1ba759..fa888c9 100644 (file)
  */
 class ApiPurge extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * Purges the cache of a page
         */
index c0929a0..cf0d841 100644 (file)
  */
 class ApiQueryDisabled extends ApiQueryBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $this->setWarning( "The \"{$this->getModuleName()}\" module has been disabled." );
        }
index 402bab1..6e55a5e 100644 (file)
  */
 class ApiRollback extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * @var Title
         */
index 752a6be..c4a1328 100644 (file)
  */
 class ApiRsd extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $result = $this->getResult();
 
index 68160fa..7a47a0c 100644 (file)
  */
 class ApiSetNotificationTimestamp extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $user = $this->getUser();
 
index 2be2b24..518bfce 100644 (file)
  */
 class ApiTokens extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                wfProfileIn( __METHOD__ );
                $params = $this->extractRequestParams();
index 5802a98..bc7f6e7 100644 (file)
  */
 class ApiUnblock extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        /**
         * Unblocks the specified user or provides the reason the unblock failed.
         */
index b1eeff3..f53f065 100644 (file)
  */
 class ApiUndelete extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $params = $this->extractRequestParams();
 
index 2d45b29..03c10d0 100644 (file)
@@ -36,10 +36,6 @@ class ApiUpload extends ApiBase {
 
        protected $mParams;
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                // Check whether upload is enabled
                if ( !UploadBase::isEnabled() ) {
index 0c6ebb1..b9b1eed 100644 (file)
  */
 class ApiUserrights extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        private $mUser = null;
 
        public function execute() {
index 16da176..2454e33 100644 (file)
  */
 class ApiWatch extends ApiBase {
 
-       public function __construct( $main, $action ) {
-               parent::__construct( $main, $action );
-       }
-
        public function execute() {
                $user = $this->getUser();
                if ( !$user->isLoggedIn() ) {