make SecondaryDataUpdate even more abstract
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 5 Apr 2012 15:08:54 +0000 (17:08 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Thu, 5 Apr 2012 15:18:44 +0000 (17:18 +0200)
changeset 2: fixed parameter documentation for SecondaryDataUpdate and SecondaryDBDataUpdate

Change-Id: I88b2bc96afd1f2f0b5e381d8977f20b6c4d4a97b

includes/LinksUpdate.php
includes/SecondaryDBDataUpdate.php
includes/SecondaryDataUpdate.php

index 8c5e61d..6c864c1 100644 (file)
@@ -24,7 +24,10 @@ class LinksUpdate extends SecondaryDBDataUpdate {
        /**@{{
         * @private
         */
-       var $mLinks,         //!< Map of title strings to IDs for the links in the document
+       var $mId,            //!< Page ID of the article linked from
+        $mTitle,         //!< Title object of the article linked from
+        $mParserOutput,  //!< Whether to queue jobs for recursive update
+        $mLinks,         //!< Map of title strings to IDs for the links in the document
                $mImages,        //!< DB keys of the images used, in the array key only
                $mTemplates,     //!< Map of title strings to IDs for the template references, including broken ones
                $mExternals,     //!< URLs of external links, array key only
@@ -42,12 +45,17 @@ class LinksUpdate extends SecondaryDBDataUpdate {
         * @param $recursive Boolean: queue jobs for recursive updates?
         */
        function __construct( $title, $parserOutput, $recursive = true ) {
+        parent::__construct( );
+
         if ( !is_object( $title ) ) {
             throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
                 "Please see Article::editUpdates() for an invocation example.\n" );
         }
 
-        parent::__construct( $title, $parserOutput );
+        $this->mTitle = $title;
+        $this->mId = $title->getArticleID();
+
+        $this->mParserOutput = $parserOutput;
 
                $this->mLinks = $parserOutput->getLinks();
                $this->mImages = $parserOutput->getImages();
@@ -743,6 +751,23 @@ class LinksUpdate extends SecondaryDBDataUpdate {
                return $arr;
        }
 
+    /**
+     * Return the title object of the page being updated
+     * @return Title
+     */
+    public function getTitle() {
+        return $this->mTitle;
+    }
+
+    /**
+     * Returns parser output
+     * @since 1.19
+     * @return ParserOutput
+     */
+    public function getParserOutput() {
+        return $this->mParserOutput;
+    }
+
        /**
         * Return the list of images used as generated by the parser
         * @return array
index 7ff18fa..1adb9a3 100644 (file)
@@ -31,15 +31,11 @@ abstract class SecondaryDBDataUpdate extends SecondaryDataUpdate {
 
        /**
         * Constructor
-        *
-        * @param $title Title of the page we're updating
-        * @param $parserOutput ParserOutput: output from a full parse of this page
-        * @param $recursive Boolean: queue jobs for recursive updates?
-        */
-    public function __construct( Title $title, ParserOutput $parserOutput ) {
+     **/
+    public function __construct( ) {
                global $wgAntiLockFlags;
 
-        parent::__construct( $title, $parserOutput );
+        parent::__construct( );
 
                if ( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) {
                        $this->mOptions = array();
index 69f6cb1..6527c2d 100644 (file)
  */
 abstract class SecondaryDataUpdate {
 
-       /**@{{
-        * @private
-        */
-       var $mId,            //!< Page ID of the article linked from
-               $mTitle,         //!< Title object of the article linked from
-               $mParserOutput;     //!< Whether to queue jobs for recursive updates
-       /**@}}*/
-
        /**
         * Constructor
-        *
-        * @param $title Title of the page we're updating
-        * @param $parserOutput ParserOutput: output from a full parse of this page
-        * @param $recursive Boolean: queue jobs for recursive updates?
         */
-    public function __construct( Title $title, ParserOutput $parserOutput) {
-               $this->mTitle = $title;
-               $this->mId = $title->getArticleID();
-
-               $this->mParserOutput = $parserOutput;
+    public function __construct( ) {
        }
 
        /**
@@ -49,21 +33,4 @@ abstract class SecondaryDataUpdate {
         */
        public abstract function doUpdate();
 
-       /**
-        * Return the title object of the page being updated
-        * @return Title
-        */
-       public function getTitle() {
-               return $this->mTitle;
-       }
-
-       /**
-        * Returns parser output
-        * @since 1.19
-        * @return ParserOutput
-        */
-       public function getParserOutput() {
-               return $this->mParserOutput;
-       }
-
 }