spaces -> tabs
authordaniel <daniel.kinzler@wikimedia.de>
Mon, 30 Apr 2012 11:48:13 +0000 (13:48 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Mon, 30 Apr 2012 11:48:13 +0000 (13:48 +0200)
includes/LinksUpdate.php
includes/SecondaryDataUpdate.php

index 1973d95..4097055 100644 (file)
@@ -25,9 +25,9 @@ class LinksUpdate extends SecondaryDBDataUpdate {
         * @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 update
-        $mLinks,         //!< Map of title strings to IDs for the links in the document
+               $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
@@ -45,21 +45,21 @@ class LinksUpdate extends SecondaryDBDataUpdate {
         * @param $recursive Boolean: queue jobs for recursive updates?
         */
        function __construct( $title, $parserOutput, $recursive = true ) {
-        parent::__construct( );
+               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" );
-        }
+               if ( !is_object( $title ) ) {
+                       throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
+                               "Please see Article::editUpdates() for an invocation example.\n" );
+               }
 
-               if ( !is_object( $title ) ) {
-                       throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " .
+               if ( !is_object( $title ) ) {
+                       throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " .
                                "Please see WikiPage::doEditUpdates() for an invocation example.\n" );
-               }
-        $this->mTitle = $title;
-        $this->mId = $title->getArticleID();
+                       }
+               $this->mTitle = $title;
+               $this->mId = $title->getArticleID();
 
-        $this->mParserOutput = $parserOutput;
+               $this->mParserOutput = $parserOutput;
 
                $this->mLinks = $parserOutput->getLinks();
                $this->mImages = $parserOutput->getImages();
@@ -276,20 +276,20 @@ class LinksUpdate extends SecondaryDBDataUpdate {
                $this->invalidatePages( NS_FILE, array_keys( $images ) );
        }
 
-    /**
-     * @param $table
-     * @param $insertions
-     * @param $fromField
-     */
-    private function dumbTableUpdate( $table, $insertions, $fromField ) {
-        $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
-        if ( count( $insertions ) ) {
-            # The link array was constructed without FOR UPDATE, so there may
-            # be collisions.  This may cause minor link table inconsistencies,
-            # which is better than crippling the site with lock contention.
-            $this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
-        }
-    }
+       /**
+        * @param $table
+        * @param $insertions
+        * @param $fromField
+        */
+       private function dumbTableUpdate( $table, $insertions, $fromField ) {
+               $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
+               if ( count( $insertions ) ) {
+                       # The link array was constructed without FOR UPDATE, so there may
+                       # be collisions.  This may cause minor link table inconsistencies,
+                       # which is better than crippling the site with lock contention.
+                       $this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
+               }
+       }
 
        /**
         * Update a table by doing a delete query then an insert query
@@ -755,22 +755,22 @@ 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 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
index eeee42f..43e7497 100644 (file)
@@ -25,8 +25,8 @@ abstract class SecondaryDataUpdate {
        /**
         * Constructor
         */
-    public function __construct( ) {
-        # noop
+       public function __construct( ) {
+               # noop
        }
 
        /**
@@ -34,18 +34,18 @@ abstract class SecondaryDataUpdate {
         */
        public abstract function doUpdate();
 
-    /**
-     * Conveniance method, calls doUpdate() on every element in the array.
-     *
-     * @static
-     * @param $updates array
-     */
-    public static function runUpdates( $updates ) {
-        if ( empty( $updates ) ) return; # nothing to do
+       /**
+        * Conveniance method, calls doUpdate() on every element in the array.
+        *
+        * @static
+        * @param $updates array
+        */
+       public static function runUpdates( $updates ) {
+               if ( empty( $updates ) ) return; # nothing to do
 
-        foreach ( $updates as $update ) {
-            $update->doUpdate();
-        }
-    }
+               foreach ( $updates as $update ) {
+                       $update->doUpdate();
+               }
+       }
 
 }