Prettify upload form for RTL wikis
[lhc/web/wiklou.git] / includes / LinksUpdate.php
index bd6e241..a52414c 100644 (file)
@@ -1,10 +1,8 @@
 <?php
 /**
- * See deferred.txt
- */
-
-/**
- * @todo document
+ * See docs/deferred.txt
+ * 
+ * @todo document (e.g. one-sentence top-level class description).
  */
 class LinksUpdate {
 
@@ -26,10 +24,10 @@ class LinksUpdate {
 
        /**
         * Constructor
-        * Initialize private variables
-        * @param $title Integer: FIXME
-        * @param $parserOutput FIXME
-        * @param $recursive Boolean: FIXME, default 'true'.
+        *
+        * @param Title $title Title of the page we're updating
+        * @param ParserOutput $parserOutput Output from a full parse of this page
+        * @param bool $recursive Queue jobs for recursive updates?
         */
        function LinksUpdate( $title, $parserOutput, $recursive = true ) {
                global $wgAntiLockFlags;
@@ -66,6 +64,8 @@ class LinksUpdate {
                }
 
                $this->mRecursive = $recursive;
+               
+               wfRunHooks( 'LinksUpdateConstructed', array( &$this ) );
        }
 
        /**
@@ -73,11 +73,15 @@ class LinksUpdate {
         */
        function doUpdate() {
                global $wgUseDumbLinkUpdate;
+               
+               wfRunHooks( 'LinksUpdate', array( &$this ) );
                if ( $wgUseDumbLinkUpdate ) {
                        $this->doDumbUpdate();
                } else {
                        $this->doIncrementalUpdate();
                }
+               wfRunHooks( 'LinksUpdateComplete', array( &$this ) );
+
        }
 
        function doIncrementalUpdate() {
@@ -190,7 +194,7 @@ class LinksUpdate {
                                        break;
                                }
                                $title = Title::makeTitle( $row->page_namespace, $row->page_title );
-                               $jobs[] = Job::factory( 'refreshLinks', $title );
+                               $jobs[] = new RefreshLinksJob( $title, '' );
                        }
                        Job::batchInsert( $jobs );
                }
@@ -595,5 +599,12 @@ class LinksUpdate {
                }
                return $arr;
        }
+       
+       /**
+        * Return the title object of the page being updated
+        */     
+       function getTitle() {
+               return $this->mTitle;
+       }
 }
-?>
+