http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72791
Revision: 72791
Author: ialex
Date: 2010-09-11 09:49:57 +0000 (Sat, 11 Sep 2010)
Log Message:
-----------
Moved SQLite specific functions to SqliteUpdater
Modified Paths:
--------------
trunk/phase3/includes/installer/SqliteUpdater.php
trunk/phase3/maintenance/updaters.inc
Modified: trunk/phase3/includes/installer/SqliteUpdater.php
===================================================================
--- trunk/phase3/includes/installer/SqliteUpdater.php 2010-09-11 09:37:08 UTC
(rev 72790)
+++ trunk/phase3/includes/installer/SqliteUpdater.php 2010-09-11 09:49:57 UTC
(rev 72791)
@@ -20,7 +20,7 @@
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' ),
@@ -38,7 +38,7 @@
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' ),
@@ -51,4 +51,31 @@
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" );
+ }
+ }
}
Modified: trunk/phase3/maintenance/updaters.inc
===================================================================
--- trunk/phase3/maintenance/updaters.inc 2010-09-11 09:37:08 UTC (rev
72790)
+++ trunk/phase3/maintenance/updaters.inc 2010-09-11 09:49:57 UTC (rev
72791)
@@ -757,35 +757,6 @@
$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' );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs