Some static functions. Fix strict errors when running updateSearchIndex.php
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 Jan 2007 19:56:23 +0000 (19:56 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 Jan 2007 19:56:23 +0000 (19:56 +0000)
includes/SearchEngine.php
includes/SearchUpdate.php
includes/Title.php
maintenance/updateSearchIndex.inc

index cec40c9..a1c6574 100644 (file)
@@ -134,7 +134,7 @@ class SearchEngine {
                return NULL;
        }
 
-       function legalSearchChars() {
+       public static function legalSearchChars() {
                return "A-Za-z_'0-9\\x80-\\xFF\\-";
        }
 
@@ -193,9 +193,8 @@ class SearchEngine {
         * active database backend, and return a configured instance.
         *
         * @return SearchEngine
-        * @private
         */
-       function create() {
+       public static function create() {
                global $wgDBtype, $wgSearchType;
                if( $wgSearchType ) {
                        $class = $wgSearchType;
index 37981a6..e117cac 100644 (file)
@@ -38,7 +38,7 @@ class SearchUpdate {
                wfProfileIn( $fname );
 
                $search = SearchEngine::create();
-               $lc = $search->legalSearchChars() . '&#;';
+               $lc = SearchEngine::legalSearchChars() . '&#;';
 
                if( $this->mText === false ) {
                        $search->updateTitle($this->mId,
index 1c858de..a47d69c 100644 (file)
@@ -347,7 +347,7 @@ class Title {
         * @return string a stripped-down title string ready for the
         *      search index
         */
-       /* static */ function indexTitle( $ns, $title ) {
+       public static function indexTitle( $ns, $title ) {
                global $wgContLang;
 
                $lc = SearchEngine::legalSearchChars() . '&#;';
index ed01575..401abff 100644 (file)
@@ -74,7 +74,9 @@ function updateSearchIndex( $start, $end, $maxLockTime, $quiet ) {
 
        # Unlock searchindex
        if ( $maxLockTime ) {
+               output( "    --- Unlocking --" );
                unlockSearchindex( $dbw );
+               output( "\n" );
        }
        output( "Done\n" );
 }
@@ -91,11 +93,11 @@ function lockSearchindex( &$db ) {
                $items[] = $db->tableName( $table ) . ' READ';
        }
        $sql = "LOCK TABLES " . implode( ',', $items );
-       $db->query( $sql );
+       $db->query( $sql, 'updateSearchIndex.inc ' . __METHOD__ );
 }
 
 function unlockSearchindex( &$db ) {
-       $db->query( "UNLOCK TABLES" );
+       $db->query( "UNLOCK TABLES", 'updateSearchIndex.inc ' . __METHOD__ );
 }
 
 # Unlock and lock again