X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=blobdiff_plain;f=maintenance%2Frebuildtextindex.php;h=ec99d84a4c3d38db562145adfe0562ed77d3a716;hb=892be949907ec5a13277395d1fd0c77d8f661f51;hp=e29d89e19378fc53df0fe467e8793083cc133418;hpb=61b2f07f6b4eb3ff676130126b40f519e125690c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index e29d89e193..ec99d84a4c 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -42,7 +42,7 @@ class RebuildTextIndex extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Rebuild search index table from scratch"; + $this->addDescription( 'Rebuild search index table from scratch' ); } public function getDbType() { @@ -51,12 +51,11 @@ class RebuildTextIndex extends Maintenance { public function execute() { // Shouldn't be needed for Postgres - $this->db = wfGetDB( DB_MASTER ); + $this->db = $this->getDB( DB_MASTER ); if ( $this->db->getType() == 'postgres' ) { $this->error( "This script is not needed when using Postgres.\n", true ); } - $this->db = wfGetDB( DB_MASTER ); if ( $this->db->getType() == 'sqlite' ) { if ( !DatabaseSqlite::getFulltextSearchModule() ) { $this->error( "Your version of SQLite module for PHP doesn't " @@ -103,8 +102,8 @@ class RebuildTextIndex extends Maintenance { } $end = $n + self::RTI_CHUNK_SIZE - 1; - $res = $this->db->select( array( 'page', 'revision', 'text' ), $fields, - array( "page_id BETWEEN $n AND $end", 'page_latest = rev_id', 'rev_text_id = old_id' ), + $res = $this->db->select( [ 'page', 'revision', 'text' ], $fields, + [ "page_id BETWEEN $n AND $end", 'page_latest = rev_id', 'rev_text_id = old_id' ], __METHOD__ );