Some static functions. Fix strict errors when running updateSearchIndex.php

This commit is contained in:
Antoine Musso 2007-01-09 19:56:23 +00:00
parent 6fc20e17ac
commit eaf2cb74c1
4 changed files with 8 additions and 7 deletions

View 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;

View 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,

View 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() . '&#;';

View 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