From eaf2cb74c1f3072a27d9bb8e45ae6574d1f6b6fb Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 9 Jan 2007 19:56:23 +0000 Subject: [PATCH 1/1] Some static functions. Fix strict errors when running updateSearchIndex.php --- includes/SearchEngine.php | 5 ++--- includes/SearchUpdate.php | 2 +- includes/Title.php | 2 +- maintenance/updateSearchIndex.inc | 6 ++++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index cec40c9166..a1c6574b0d 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -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; diff --git a/includes/SearchUpdate.php b/includes/SearchUpdate.php index 37981a67d7..e117cac05a 100644 --- a/includes/SearchUpdate.php +++ b/includes/SearchUpdate.php @@ -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, diff --git a/includes/Title.php b/includes/Title.php index 1c858de411..a47d69c5ef 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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() . '&#;'; diff --git a/maintenance/updateSearchIndex.inc b/maintenance/updateSearchIndex.inc index ed01575c32..401abff0a5 100644 --- a/maintenance/updateSearchIndex.inc +++ b/maintenance/updateSearchIndex.inc @@ -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 -- 2.20.1