* Refactoring ApiQueryImageInfo to use new File::loadHistory() interface. No change...
[lhc/web/wiklou.git] / includes / SearchUpdate.php
index 3396eb9..849d6dc 100644 (file)
@@ -1,12 +1,7 @@
 <?php
 /**
  * See deferred.txt
- * @package MediaWiki
- */
-
-/**
- *
- * @package MediaWiki
+ * @addtogroup Search
  */
 class SearchUpdate {
 
@@ -29,7 +24,7 @@ class SearchUpdate {
        }
 
        function doUpdate() {
-               global $wgDBminWordLen, $wgContLang, $wgDisableSearchUpdate;
+               global $wgContLang, $wgDisableSearchUpdate;
 
                if( $wgDisableSearchUpdate || !$this->mId ) {
                        return false;
@@ -37,10 +32,9 @@ class SearchUpdate {
                $fname = 'SearchUpdate::doUpdate';
                wfProfileIn( $fname );
 
-               require_once( 'SearchEngine.php' );
                $search = SearchEngine::create();
-               $lc = $search->legalSearchChars() . '&#;';
-               
+               $lc = SearchEngine::legalSearchChars() . '&#;';
+
                if( $this->mText === false ) {
                        $search->updateTitle($this->mId,
                                Title::indexTitle( $this->mNamespace, $this->mTitle ));
@@ -99,18 +93,23 @@ class SearchUpdate {
                # Strip wiki '' and '''
                $text = preg_replace( "/''[']*/", " ", $text );
                wfProfileOut( "$fname-regexps" );
+
+               wfRunHooks( 'SearchUpdate', array( $this->mId, $this->mNamespace, $this->mTitle, &$text ) );
+               
+               # Perform the actual update
                $search->update($this->mId, Title::indexTitle( $this->mNamespace, $this->mTitle ),
                                $text);
+               
                wfProfileOut( $fname );
        }
 }
 
 /**
  * Placeholder class
- * @package MediaWiki
+ * @addtogroup Search
  */
 class SearchUpdateMyISAM extends SearchUpdate {
        # Inherits everything
 }
 
-?>
+