From: Antoine Musso Date: Mon, 14 May 2007 20:24:10 +0000 (+0000) Subject: This is only for MySQL. X-Git-Tag: 1.31.0-rc.0~52916 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=1623b226293e5e7173f1d4b40852693f2c7016a6;p=lhc%2Fweb%2Fwiklou.git This is only for MySQL. --- diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index 6f31cbb6b5..6fed4aa967 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -3,6 +3,9 @@ * Rebuild search index table from scratch. This takes several * hours, depending on the database size and server configuration. * + * This is only for MySQL (see bug 9905). For postgres we can probably + * use SearchPostgres::update($pageid); + * * @todo document * @addtogroup Maintenance */ @@ -10,9 +13,14 @@ /** */ require_once( "commandLine.inc" ); require_once( "rebuildtextindex.inc" ); -$wgTitle = Title::newFromText( "Rebuild text index script" ); -$database = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); +$database = wfGetDB( DB_MASTER ); +if( !$database instanceof DatabaseMysql ) { + print "This script is only for MySQL.\n"; + exit(); +} + +$wgTitle = Title::newFromText( "Rebuild text index script" ); dropTextIndex( $database ); rebuildTextIndex( $database );