Localisation updates for core from Betawiki
[lhc/web/wiklou.git] / includes / SearchUpdate.php
index 135d9f0..087a8ba 100644 (file)
@@ -1,21 +1,12 @@
 <?php
 /**
  * See deferred.txt
- * @package MediaWiki
- */
-
-/**
- *
- * @package MediaWiki
+ * @ingroup Search
  */
 class SearchUpdate {
 
-       private
-               $mId = 0,
-               $mNamespace,
-               $mTitle,
-               $mText,
-               $mTitleWords;
+       /* private */ var $mId = 0, $mNamespace, $mTitle, $mText;
+       /* private */ var $mTitleWords;
 
        function SearchUpdate( $id, $title, $text = false ) {
                $nt = Title::newFromText( $title );
@@ -41,9 +32,8 @@ 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,
@@ -103,18 +93,21 @@ 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
+ * @ingroup Search
  */
 class SearchUpdateMyISAM extends SearchUpdate {
        # Inherits everything
 }
-
-?>