Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -757,35 +757,6 @@ |
758 | 758 | $task->execute(); |
759 | 759 | } |
760 | 760 | |
761 | | -function sqlite_initial_indexes() { |
762 | | - $dbw = wfGetDB( DB_MASTER ); |
763 | | - // initial-indexes.sql fails if the indexes are already present, so we perform a quick check if our database is newer. |
764 | | - if ( update_row_exists( 'initial_indexes' ) || $dbw->indexExists( 'user', 'user_name' ) ) { |
765 | | - wfOut( "...have initial indexes\n" ); |
766 | | - return; |
767 | | - } |
768 | | - wfOut( "Adding initial indexes..." ); |
769 | | - $dbw->sourceFile( archive( 'initial-indexes.sql' ) ); |
770 | | - wfOut( "done\n" ); |
771 | | -} |
772 | | - |
773 | | -function sqlite_setup_searchindex() { |
774 | | - $dbw = wfGetDB( DB_MASTER ); |
775 | | - $module = $dbw->getFulltextSearchModule(); |
776 | | - $fts3tTable = update_row_exists( 'fts3' ); |
777 | | - if ( $fts3tTable && !$module ) { |
778 | | - wfOut( '...PHP is missing FTS3 support, downgrading tables...' ); |
779 | | - $dbw->sourceFile( archive( 'searchindex-no-fts.sql' ) ); |
780 | | - wfOut( "done\n" ); |
781 | | - } elseif ( !$fts3tTable && $module == 'FTS3' ) { |
782 | | - wfOut( '...adding FTS3 search capabilities...' ); |
783 | | - $dbw->sourceFile( archive( 'searchindex-fts3.sql' ) ); |
784 | | - wfOut( "done\n" ); |
785 | | - } else { |
786 | | - wfOut( "...fulltext search table appears to be in order.\n" ); |
787 | | - } |
788 | | -} |
789 | | - |
790 | 761 | function do_unique_pl_tl_il() { |
791 | 762 | $dbw = wfGetDB( DB_MASTER ); |
792 | 763 | $info = $dbw->indexInfo( 'pagelinks', 'pl_namespace' ); |
Index: trunk/phase3/includes/installer/SqliteUpdater.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | array( 'addField', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ), |
22 | 22 | array( 'do_active_users_init' ), |
23 | 23 | array( 'addField', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ), |
24 | | - array( 'sqlite_initial_indexes' ), |
| 24 | + array( 'sqliteInitialIndexes' ), |
25 | 25 | |
26 | 26 | // 1.15 |
27 | 27 | array( 'addTable', 'change_tag', 'patch-change_tag.sql' ), |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | array( 'addIndex', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ), |
40 | 40 | array( 'addField', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ), |
41 | 41 | array( 'do_update_transcache_field' ), |
42 | | - array( 'sqlite_setup_searchindex' ), |
| 42 | + array( 'sqliteSetupSearchindex' ), |
43 | 43 | |
44 | 44 | // 1.17 |
45 | 45 | array( 'addTable', 'iwlinks', 'patch-iwlinks.sql' ), |
— | — | @@ -51,4 +51,31 @@ |
52 | 52 | array( 'addTable', 'module_deps', 'patch-module_deps.sql' ), |
53 | 53 | ); |
54 | 54 | } |
| 55 | + |
| 56 | + protected function sqliteInitialIndexes() { |
| 57 | + // initial-indexes.sql fails if the indexes are already present, so we perform a quick check if our database is newer. |
| 58 | + if ( update_row_exists( 'initial_indexes' ) || $this->db->indexExists( 'user', 'user_name' ) ) { |
| 59 | + wfOut( "...have initial indexes\n" ); |
| 60 | + return; |
| 61 | + } |
| 62 | + wfOut( "Adding initial indexes..." ); |
| 63 | + $this->applyPatch( 'initial-indexes.sql' ); |
| 64 | + wfOut( "done\n" ); |
| 65 | + } |
| 66 | + |
| 67 | + protected function sqliteSetupSearchindex() { |
| 68 | + $module = $this->db->getFulltextSearchModule(); |
| 69 | + $fts3tTable = update_row_exists( 'fts3' ); |
| 70 | + if ( $fts3tTable && !$module ) { |
| 71 | + wfOut( '...PHP is missing FTS3 support, downgrading tables...' ); |
| 72 | + $this->applyPatch( 'searchindex-no-fts.sql' ); |
| 73 | + wfOut( "done\n" ); |
| 74 | + } elseif ( !$fts3tTable && $module == 'FTS3' ) { |
| 75 | + wfOut( '...adding FTS3 search capabilities...' ); |
| 76 | + $this->applyPatch( 'searchindex-fts3.sql' ); |
| 77 | + wfOut( "done\n" ); |
| 78 | + } else { |
| 79 | + wfOut( "...fulltext search table appears to be in order.\n" ); |
| 80 | + } |
| 81 | + } |
55 | 82 | } |