New hooks: LinksUpdate, LinksUpdateComplete. Add function getTitle to LinksUpdate.
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 9 Feb 2008 12:32:32 +0000 (12:32 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 9 Feb 2008 12:32:32 +0000 (12:32 +0000)
docs/hooks.txt
includes/LinksUpdate.php

index fb9517a..17ac821 100644 (file)
@@ -637,6 +637,12 @@ $lang: laguage code (string)
 $specialPageAliases: associative array of magic words synonyms
 $lang: laguage code (string)
 
+'LinksUpdate': At the beginning of LinksUpdate::doUpdate() just before the actual update
+&$linksUpdate: the LinkUpdate object
+
+'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating has completed
+&$linksUpdate: the LinkUpdate object
+
 'LinksUpdateConstructed': At the end of LinksUpdate() is contruction.
 &$linksUpdate: the LinkUpdate object
 
index 9bcd9d6..a52414c 100644 (file)
@@ -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() {
@@ -595,5 +599,12 @@ class LinksUpdate {
                }
                return $arr;
        }
+       
+       /**
+        * Return the title object of the page being updated
+        */     
+       function getTitle() {
+               return $this->mTitle;
+       }
 }