array( 'addField', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
array( 'do_active_users_init' ),
array( 'addField', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
- array( 'sqlite_initial_indexes' ),
+ array( 'sqliteInitialIndexes' ),
// 1.15
array( 'addTable', 'change_tag', 'patch-change_tag.sql' ),
array( 'addIndex', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
array( 'addField', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
array( 'do_update_transcache_field' ),
- array( 'sqlite_setup_searchindex' ),
+ array( 'sqliteSetupSearchindex' ),
// 1.17
array( 'addTable', 'iwlinks', 'patch-iwlinks.sql' ),
array( 'addTable', 'module_deps', 'patch-module_deps.sql' ),
);
}
+
+ protected function sqliteInitialIndexes() {
+ // initial-indexes.sql fails if the indexes are already present, so we perform a quick check if our database is newer.
+ if ( update_row_exists( 'initial_indexes' ) || $this->db->indexExists( 'user', 'user_name' ) ) {
+ wfOut( "...have initial indexes\n" );
+ return;
+ }
+ wfOut( "Adding initial indexes..." );
+ $this->applyPatch( 'initial-indexes.sql' );
+ wfOut( "done\n" );
+ }
+
+ protected function sqliteSetupSearchindex() {
+ $module = $this->db->getFulltextSearchModule();
+ $fts3tTable = update_row_exists( 'fts3' );
+ if ( $fts3tTable && !$module ) {
+ wfOut( '...PHP is missing FTS3 support, downgrading tables...' );
+ $this->applyPatch( 'searchindex-no-fts.sql' );
+ wfOut( "done\n" );
+ } elseif ( !$fts3tTable && $module == 'FTS3' ) {
+ wfOut( '...adding FTS3 search capabilities...' );
+ $this->applyPatch( 'searchindex-fts3.sql' );
+ wfOut( "done\n" );
+ } else {
+ wfOut( "...fulltext search table appears to be in order.\n" );
+ }
+ }
}
$task->execute();
}
-function sqlite_initial_indexes() {
- $dbw = wfGetDB( DB_MASTER );
- // initial-indexes.sql fails if the indexes are already present, so we perform a quick check if our database is newer.
- if ( update_row_exists( 'initial_indexes' ) || $dbw->indexExists( 'user', 'user_name' ) ) {
- wfOut( "...have initial indexes\n" );
- return;
- }
- wfOut( "Adding initial indexes..." );
- $dbw->sourceFile( archive( 'initial-indexes.sql' ) );
- wfOut( "done\n" );
-}
-
-function sqlite_setup_searchindex() {
- $dbw = wfGetDB( DB_MASTER );
- $module = $dbw->getFulltextSearchModule();
- $fts3tTable = update_row_exists( 'fts3' );
- if ( $fts3tTable && !$module ) {
- wfOut( '...PHP is missing FTS3 support, downgrading tables...' );
- $dbw->sourceFile( archive( 'searchindex-no-fts.sql' ) );
- wfOut( "done\n" );
- } elseif ( !$fts3tTable && $module == 'FTS3' ) {
- wfOut( '...adding FTS3 search capabilities...' );
- $dbw->sourceFile( archive( 'searchindex-fts3.sql' ) );
- wfOut( "done\n" );
- } else {
- wfOut( "...fulltext search table appears to be in order.\n" );
- }
-}
-
function do_unique_pl_tl_il() {
$dbw = wfGetDB( DB_MASTER );
$info = $dbw->indexInfo( 'pagelinks', 'pl_namespace' );