Merge "worthwhile tests in testTitleObjectStringConversion"
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.php
index b0934eb..41b245f 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  * @todo document
  */
 
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
 
+/**
+ * Maintenance script that rebuilds search index table from scratch.
+ *
+ * @ingroup Maintenance
+ */
 class RebuildTextIndex extends Maintenance {
        const RTI_CHUNK_SIZE = 500;
+
+       /**
+        * @var DatabaseBase
+        */
        private $db;
 
        public function __construct() {
@@ -108,7 +118,7 @@ class RebuildTextIndex extends Maintenance {
         */
        private function dropMysqlTextIndex() {
                $searchindex = $this->db->tableName( 'searchindex' );
-               if ( $this->db->indexExists( 'searchindex', 'si_title' ) ) {
+               if ( $this->db->indexExists( 'searchindex', 'si_title', __METHOD__ ) ) {
                        $this->output( "Dropping index...\n" );
                        $sql = "ALTER TABLE $searchindex DROP INDEX si_title, DROP INDEX si_text";
                        $this->db->query( $sql, __METHOD__ );