r69187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69186‎ | r69187 | r69188 >
Date:14:57, 8 July 2010
Author:demon
Status:ok
Tags:
Comment:
Refactor a lot of updaters.inc into some classes in the installer code. Still need all these blasted global functions. And OpenID still uses $wgUpdates, so support for it remains...for now!
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/installer/Update.php (added) (history)
  • /trunk/phase3/includes/installer/Updaters.php (added) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -15,204 +15,11 @@
1616 require_once( "$IP/includes/Hooks.php" );
1717
1818 /**
19 - * List of update functions to call for each DB type, in sequence. First item
20 - * is function name, rest are parameters to pass.
 19+ * @deprecated. Do not use, ever.
2120 */
22 -$wgUpdates = array(
23 - 'mysql' => array(
24 - // 1.2
25 - // update_passwords obsolete
26 - array( 'add_field', 'ipblocks', 'ipb_id', 'patch-ipblocks.sql' ),
27 - array( 'add_field', 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ),
28 - array( 'do_interwiki_update' ),
29 - array( 'do_index_update' ),
30 - // do_linkscc_update obsolete
31 - array( 'add_table', 'hitcounter', 'patch-hitcounter.sql' ),
32 - array( 'add_field', 'recentchanges', 'rc_type', 'patch-rc_type.sql' ),
 21+$wgUpdates = array();
3322
34 - // 1.3
35 - array( 'add_field', 'user', 'user_real_name', 'patch-user-realname.sql' ),
36 - array( 'add_table', 'querycache', 'patch-querycache.sql' ),
37 - array( 'add_table', 'objectcache', 'patch-objectcache.sql' ),
38 - array( 'add_table', 'categorylinks', 'patch-categorylinks.sql' ),
39 - // do_linkscc_1_3_update obsolete
40 - array( 'do_old_links_update' ),
41 - array( 'fix_ancient_imagelinks' ),
42 - array( 'add_field', 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ),
4323
44 - // 1.4
45 - array( 'do_image_name_unique_update' ),
46 - array( 'add_field', 'recentchanges', 'rc_id', 'patch-rc_id.sql' ),
47 - array( 'add_field', 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
48 - array( 'add_table', 'logging', 'patch-logging.sql' ),
49 - // do_user_rights_update obsolete
50 - array( 'add_field', 'user', 'user_token', 'patch-user_token.sql' ),
51 - // old, old_articleid, patch-remove-old-title-namespace.sql obsolete
52 - // user_groups, patch-userlevels.sql obsolete
53 - // do_group_update() obsolete
54 - array( 'do_watchlist_update' ),
55 - array( 'do_user_update' ),
56 - // do_copy_newtalk_to_watchlist obsolete
57 -
58 - // 1.5
59 - array( 'do_schema_restructuring' ),
60 - array( 'add_field', 'logging', 'log_params', 'patch-log_params.sql' ),
61 - array( 'check_bin', 'logging', 'log_title', 'patch-logging-title.sql', ),
62 - array( 'add_field', 'archive', 'ar_rev_id', 'patch-archive-rev_id.sql' ),
63 - array( 'add_field', 'page', 'page_len', 'patch-page_len.sql' ),
64 - array( 'do_inverse_timestamp' ),
65 - array( 'do_text_id' ),
66 - array( 'add_field', 'revision', 'rev_deleted', 'patch-rev_deleted.sql' ),
67 - array( 'add_field', 'image', 'img_width', 'patch-img_width.sql' ),
68 - array( 'add_field', 'image', 'img_metadata', 'patch-img_metadata.sql' ),
69 - array( 'add_field', 'user', 'user_email_token', 'patch-user_email_token.sql' ),
70 - array( 'add_field', 'archive', 'ar_text_id', 'patch-archive-text_id.sql' ),
71 - array( 'do_namespace_size' ),
72 - array( 'add_field', 'image', 'img_media_type', 'patch-img_media_type.sql' ),
73 - array( 'do_pagelinks_update' ),
74 - array( 'do_drop_img_type' ),
75 - array( 'do_user_unique_update' ),
76 - array( 'do_user_groups_update' ),
77 - array( 'add_field', 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ),
78 - array( 'add_table', 'user_newtalk', 'patch-usernewtalk2.sql' ),
79 - array( 'add_table', 'transcache', 'patch-transcache.sql' ),
80 - array( 'add_field', 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ),
81 - array( 'add_table', 'trackbacks', 'patch-trackbacks.sql' ),
82 -
83 - // 1.6
84 - array( 'do_watchlist_null' ),
85 - // do_image_index_update obsolete
86 - array( 'do_logging_timestamp_index' ),
87 - array( 'add_field', 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ),
88 - array( 'do_page_random_update' ),
89 - array( 'add_field', 'user', 'user_registration', 'patch-user_registration.sql' ),
90 - array( 'do_templatelinks_update' ),
91 - array( 'add_table', 'externallinks', 'patch-externallinks.sql' ),
92 - array( 'add_table', 'job', 'patch-job.sql' ),
93 - array( 'add_field', 'site_stats', 'ss_images', 'patch-ss_images.sql' ),
94 - array( 'add_table', 'langlinks', 'patch-langlinks.sql' ),
95 - array( 'add_table', 'querycache_info', 'patch-querycacheinfo.sql' ),
96 - array( 'add_table', 'filearchive', 'patch-filearchive.sql' ),
97 - array( 'add_field', 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ),
98 - array( 'do_rc_indices_update' ),
99 -
100 - // 1.9
101 - array( 'add_field', 'user', 'user_newpass_time', 'patch-user_newpass_time.sql' ),
102 - array( 'add_table', 'redirect', 'patch-redirect.sql' ),
103 - array( 'add_table', 'querycachetwo', 'patch-querycachetwo.sql' ),
104 - array( 'add_field', 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
105 - array( 'do_backlinking_indices_update' ),
106 - array( 'add_field', 'recentchanges', 'rc_old_len', 'patch-rc_len.sql' ),
107 - array( 'add_field', 'user', 'user_editcount', 'patch-user_editcount.sql' ),
108 -
109 - // 1.10
110 - array( 'do_restrictions_update' ),
111 - array( 'add_field', 'logging', 'log_id', 'patch-log_id.sql' ),
112 - array( 'add_field', 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ),
113 - array( 'add_field', 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ),
114 - array( 'add_field', 'revision', 'rev_len', 'patch-rev_len.sql' ),
115 - array( 'add_field', 'recentchanges', 'rc_deleted', 'patch-rc_deleted.sql' ),
116 - array( 'add_field', 'logging', 'log_deleted', 'patch-log_deleted.sql' ),
117 - array( 'add_field', 'archive', 'ar_deleted', 'patch-ar_deleted.sql' ),
118 - array( 'add_field', 'ipblocks', 'ipb_deleted', 'patch-ipb_deleted.sql' ),
119 - array( 'add_field', 'filearchive', 'fa_deleted', 'patch-fa_deleted.sql' ),
120 - array( 'add_field', 'archive', 'ar_len', 'patch-ar_len.sql' ),
121 -
122 - // 1.11
123 - array( 'add_field', 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ),
124 - array( 'do_categorylinks_indices_update' ),
125 - array( 'add_field', 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ),
126 - array( 'do_archive_user_index' ),
127 - array( 'do_image_user_index' ),
128 - array( 'do_oldimage_user_index' ),
129 - array( 'add_field', 'archive', 'ar_page_id', 'patch-archive-page_id.sql' ),
130 - array( 'add_field', 'image', 'img_sha1', 'patch-img_sha1.sql' ),
131 -
132 - // 1.12
133 - array( 'add_table', 'protected_titles', 'patch-protected_titles.sql' ),
134 -
135 - // 1.13
136 - array( 'add_field', 'ipblocks', 'ipb_by_text', 'patch-ipb_by_text.sql' ),
137 - array( 'add_table', 'page_props', 'patch-page_props.sql' ),
138 - array( 'add_table', 'updatelog', 'patch-updatelog.sql' ),
139 - array( 'add_table', 'category', 'patch-category.sql' ),
140 - array( 'do_category_population' ),
141 - array( 'add_field', 'archive', 'ar_parent_id', 'patch-ar_parent_id.sql' ),
142 - array( 'add_field', 'user_newtalk', 'user_last_timestamp', 'patch-user_last_timestamp.sql' ),
143 - array( 'do_populate_parent_id' ),
144 - array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ),
145 - array( 'maybe_do_profiling_memory_update' ),
146 - array( 'do_filearchive_indices_update' ),
147 -
148 - // 1.14
149 - array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
150 - array( 'do_active_users_init' ),
151 - array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
152 -
153 - // 1.15
154 - array( 'do_unique_pl_tl_il' ),
155 - array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
156 - array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
157 - array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
158 -
159 - // 1.16
160 - array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
161 - array( 'add_table', 'log_search', 'patch-log_search.sql' ),
162 - array( 'do_log_search_population' ),
163 - array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
164 - array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
165 - array( 'add_table', 'external_user', 'patch-external_user.sql' ),
166 - array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
167 - array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
168 - array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
169 - array( 'do_update_transcache_field' ),
170 - // A field changed name mid-release cycle, so fix it for anyone using
171 - // trunk
172 - array( 'rename_eu_wiki_id' ),
173 - array( 'do_update_mime_minor_field' ),
174 - // Should've done this back in 1.10, but better late than never:
175 - array( 'do_populate_rev_len' ),
176 -
177 - // 1.17
178 - array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
179 - array( 'add_index', 'iwlinks', 'iwl_prefix_from_title', 'patch-rename-iwl_prefix.sql' ),
180 - array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
181 - ),
182 -
183 - 'sqlite' => array(
184 - // 1.14
185 - array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
186 - array( 'do_active_users_init' ),
187 - array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
188 - array( 'sqlite_initial_indexes' ),
189 -
190 - // 1.15
191 - array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
192 - array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
193 - array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
194 -
195 - // 1.16
196 - array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
197 - array( 'add_table', 'log_search', 'patch-log_search.sql' ),
198 - array( 'do_log_search_population' ),
199 - array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
200 - array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
201 - array( 'add_table', 'external_user', 'patch-external_user.sql' ),
202 - array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
203 - array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
204 - array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
205 - array( 'do_update_transcache_field' ),
206 - // version-independent searchindex setup, added in 1.16
207 - array( 'sqlite_setup_searchindex' ),
208 -
209 - // 1.17
210 - array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
211 - array( 'add_index', 'iwlinks', 'iwl_prefix_from_title', 'patch-rename-iwl_prefix.sql' ),
212 - array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
213 - ),
214 -);
215 -
216 -
21724 # For extensions only, should be populated via hooks
21825 # $wgDBtype should be checked to specifiy the proper file
21926 $wgExtNewTables = array(); // table, dir
@@ -1141,7 +948,11 @@
1142949 return;
1143950 }
1144951
1145 - # Run core updates in sequence...
 952+ global $wgDatabase;
 953+ $up = new Update( $wgDatabase );
 954+ $up->doUpdates();
 955+
 956+ // OpenID is still using this stupid thing, or we could kill this too
1146957 global $wgUpdates;
1147958 if ( isset( $wgUpdates[$wgDBtype] ) ) {
1148959 foreach ( $wgUpdates[$wgDBtype] as $params ) {
Index: trunk/phase3/includes/installer/Update.php
@@ -0,0 +1,70 @@
 2+<?php
 3+/*
 4+ * Class for handling database updates. Roughly based off of updaters.inc, with
 5+ * a few improvements :)
 6+ */
 7+
 8+class Update {
 9+
 10+ // Array of updates to perform on the database
 11+ protected $updates = array();
 12+
 13+ // Thing we'll need
 14+ protected $db, $updater;
 15+
 16+ public function __construct( $db ) {
 17+ $this->db = $db;
 18+ switch( $this->db->getType() ) {
 19+ case 'mysql':
 20+ $this->updater = new MysqlUpdaters();
 21+ break;
 22+ case 'sqlite':
 23+ $this->updater = new SqliteUpdaters();
 24+ break;
 25+ default:
 26+ throw new MWException( __METHOD__ . ' called for unsupported $wgDBtype' );
 27+ }
 28+ }
 29+
 30+ public function doUpdates() {
 31+ global $IP;
 32+ require_once( "$IP/maintenance/updaters.inc" );
 33+ $this->loadUpdates();
 34+ foreach ( $this->updates as $version => $updates ) {
 35+ foreach( $updates as $params ) {
 36+ $func = array_shift( $params );
 37+ call_user_func_array( $func, $params );
 38+ flush();
 39+ }
 40+ $this->setAppliedUpdates( $version, $updates );
 41+ }
 42+ }
 43+
 44+ protected function loadUpdates() {
 45+ foreach( $this->updater->getUpdates() as $version => $updates ) {
 46+ $appliedUpdates = $this->getAppliedUpdates( $version );
 47+ if( !$appliedUpdates || count( $appliedUpdates ) != count( $updates ) ) {
 48+ $this->updates[ $version ] = $updates;
 49+ }
 50+ }
 51+ }
 52+
 53+ private function getAppliedUpdates( $version ) {
 54+ $key = "updatelist-$version";
 55+ $val = $this->db->selectField( 'updatelog', 'ul_value',
 56+ array( 'ul_key' => $key ), __METHOD__ );
 57+ if( !$val ) {
 58+ return null;
 59+ } else {
 60+ return unserialize( $val );
 61+ }
 62+ }
 63+
 64+ private function setAppliedUpdates( $version, $updates = array() ) {
 65+ $key = "updatelist-$version";
 66+ $this->db->delete( 'updatelog', array( 'ul_key' => $key ), __METHOD__ );
 67+ $this->db->insert( 'updatelog',
 68+ array( 'ul_key' => $key, 'ul_value' => serialize( $updates ) ),
 69+ __METHOD__ );
 70+ }
 71+}
Property changes on: trunk/phase3/includes/installer/Update.php
___________________________________________________________________
Added: svn:eol-style
172 + native
Index: trunk/phase3/includes/installer/Updaters.php
@@ -0,0 +1,212 @@
 2+<?php
 3+/**
 4+ * All DBs supported by MediaWiki need to implement this. Base interface for
 5+ * Updaters, which is replacing updaters.inc
 6+ */
 7+interface Updaters {
 8+ /**
 9+ * Get an array of updates to perform on the database. Should return a
 10+ * mutli-dimensional array. The main key is the MediaWiki version (1.12,
 11+ * 1.13...) with the values being arrays of updates, identical to how
 12+ * updaters.inc did it (for now)
 13+ *
 14+ * @return Array
 15+ */
 16+ public function getUpdates();
 17+}
 18+
 19+/**
 20+ * Mysql implementation
 21+ */
 22+class MysqlUpdaters implements Updaters {
 23+
 24+ public function getUpdates() {
 25+ return array(
 26+ '1.2' => array(
 27+ array( 'add_field', 'ipblocks', 'ipb_id', 'patch-ipblocks.sql' ),
 28+ array( 'add_field', 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ),
 29+ array( 'do_interwiki_update' ),
 30+ array( 'do_index_update' ),
 31+ array( 'add_table', 'hitcounter', 'patch-hitcounter.sql' ),
 32+ array( 'add_field', 'recentchanges', 'rc_type', 'patch-rc_type.sql' ),
 33+ ),
 34+ '1.3' => array(
 35+ array( 'add_field', 'user', 'user_real_name', 'patch-user-realname.sql' ),
 36+ array( 'add_table', 'querycache', 'patch-querycache.sql' ),
 37+ array( 'add_table', 'objectcache', 'patch-objectcache.sql' ),
 38+ array( 'add_table', 'categorylinks', 'patch-categorylinks.sql' ),
 39+ array( 'do_old_links_update' ),
 40+ array( 'fix_ancient_imagelinks' ),
 41+ array( 'add_field', 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ),
 42+ ),
 43+ '1.4' => array(
 44+ array( 'do_image_name_unique_update' ),
 45+ array( 'add_field', 'recentchanges', 'rc_id', 'patch-rc_id.sql' ),
 46+ array( 'add_field', 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
 47+ array( 'add_table', 'logging', 'patch-logging.sql' ),
 48+ array( 'add_field', 'user', 'user_token', 'patch-user_token.sql' ),
 49+ array( 'do_watchlist_update' ),
 50+ array( 'do_user_update' ),
 51+ ),
 52+ '1.5' => array(
 53+ array( 'do_schema_restructuring' ),
 54+ array( 'add_field', 'logging', 'log_params', 'patch-log_params.sql' ),
 55+ array( 'check_bin', 'logging', 'log_title', 'patch-logging-title.sql', ),
 56+ array( 'add_field', 'archive', 'ar_rev_id', 'patch-archive-rev_id.sql' ),
 57+ array( 'add_field', 'page', 'page_len', 'patch-page_len.sql' ),
 58+ array( 'do_inverse_timestamp' ),
 59+ array( 'do_text_id' ),
 60+ array( 'add_field', 'revision', 'rev_deleted', 'patch-rev_deleted.sql' ),
 61+ array( 'add_field', 'image', 'img_width', 'patch-img_width.sql' ),
 62+ array( 'add_field', 'image', 'img_metadata', 'patch-img_metadata.sql' ),
 63+ array( 'add_field', 'user', 'user_email_token', 'patch-user_email_token.sql' ),
 64+ array( 'add_field', 'archive', 'ar_text_id', 'patch-archive-text_id.sql' ),
 65+ array( 'do_namespace_size' ),
 66+ array( 'add_field', 'image', 'img_media_type', 'patch-img_media_type.sql' ),
 67+ array( 'do_pagelinks_update' ),
 68+ array( 'do_drop_img_type' ),
 69+ array( 'do_user_unique_update' ),
 70+ array( 'do_user_groups_update' ),
 71+ array( 'add_field', 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ),
 72+ array( 'add_table', 'user_newtalk', 'patch-usernewtalk2.sql' ),
 73+ array( 'add_table', 'transcache', 'patch-transcache.sql' ),
 74+ array( 'add_field', 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ),
 75+ array( 'add_table', 'trackbacks', 'patch-trackbacks.sql' ),
 76+ ),
 77+ '1.6' => array(
 78+ array( 'do_watchlist_null' ),
 79+ array( 'do_logging_timestamp_index' ),
 80+ array( 'add_field', 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ),
 81+ array( 'do_page_random_update' ),
 82+ array( 'add_field', 'user', 'user_registration', 'patch-user_registration.sql' ),
 83+ array( 'do_templatelinks_update' ),
 84+ array( 'add_table', 'externallinks', 'patch-externallinks.sql' ),
 85+ array( 'add_table', 'job', 'patch-job.sql' ),
 86+ array( 'add_field', 'site_stats', 'ss_images', 'patch-ss_images.sql' ),
 87+ array( 'add_table', 'langlinks', 'patch-langlinks.sql' ),
 88+ array( 'add_table', 'querycache_info', 'patch-querycacheinfo.sql' ),
 89+ array( 'add_table', 'filearchive', 'patch-filearchive.sql' ),
 90+ array( 'add_field', 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ),
 91+ array( 'do_rc_indices_update' ),
 92+ ),
 93+ '1.9' => array(
 94+ array( 'add_field', 'user', 'user_newpass_time', 'patch-user_newpass_time.sql' ),
 95+ array( 'add_table', 'redirect', 'patch-redirect.sql' ),
 96+ array( 'add_table', 'querycachetwo', 'patch-querycachetwo.sql' ),
 97+ array( 'add_field', 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
 98+ array( 'do_backlinking_indices_update' ),
 99+ array( 'add_field', 'recentchanges', 'rc_old_len', 'patch-rc_len.sql' ),
 100+ array( 'add_field', 'user', 'user_editcount', 'patch-user_editcount.sql' ),
 101+ ),
 102+ '1.10' => array(
 103+ array( 'do_restrictions_update' ),
 104+ array( 'add_field', 'logging', 'log_id', 'patch-log_id.sql' ),
 105+ array( 'add_field', 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ),
 106+ array( 'add_field', 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ),
 107+ array( 'add_field', 'revision', 'rev_len', 'patch-rev_len.sql' ),
 108+ array( 'add_field', 'recentchanges', 'rc_deleted', 'patch-rc_deleted.sql' ),
 109+ array( 'add_field', 'logging', 'log_deleted', 'patch-log_deleted.sql' ),
 110+ array( 'add_field', 'archive', 'ar_deleted', 'patch-ar_deleted.sql' ),
 111+ array( 'add_field', 'ipblocks', 'ipb_deleted', 'patch-ipb_deleted.sql' ),
 112+ array( 'add_field', 'filearchive', 'fa_deleted', 'patch-fa_deleted.sql' ),
 113+ array( 'add_field', 'archive', 'ar_len', 'patch-ar_len.sql' ),
 114+ ),
 115+ '1.11' => array(
 116+ array( 'add_field', 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ),
 117+ array( 'do_categorylinks_indices_update' ),
 118+ array( 'add_field', 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ),
 119+ array( 'do_archive_user_index' ),
 120+ array( 'do_image_user_index' ),
 121+ array( 'do_oldimage_user_index' ),
 122+ array( 'add_field', 'archive', 'ar_page_id', 'patch-archive-page_id.sql' ),
 123+ array( 'add_field', 'image', 'img_sha1', 'patch-img_sha1.sql' ),
 124+ ),
 125+ '1.12' => array(
 126+ array( 'add_table', 'protected_titles', 'patch-protected_titles.sql' ),
 127+ ),
 128+ '1.13' => array(
 129+ array( 'add_field', 'ipblocks', 'ipb_by_text', 'patch-ipb_by_text.sql' ),
 130+ array( 'add_table', 'page_props', 'patch-page_props.sql' ),
 131+ array( 'add_table', 'updatelog', 'patch-updatelog.sql' ),
 132+ array( 'add_table', 'category', 'patch-category.sql' ),
 133+ array( 'do_category_population' ),
 134+ array( 'add_field', 'archive', 'ar_parent_id', 'patch-ar_parent_id.sql' ),
 135+ array( 'add_field', 'user_newtalk', 'user_last_timestamp', 'patch-user_last_timestamp.sql' ),
 136+ array( 'do_populate_parent_id' ),
 137+ array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ),
 138+ array( 'maybe_do_profiling_memory_update' ),
 139+ array( 'do_filearchive_indices_update' ),
 140+ ),
 141+ '1.14' => array(
 142+ array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
 143+ array( 'do_active_users_init' ),
 144+ array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
 145+ ),
 146+ '1.15' => array(
 147+ array( 'do_unique_pl_tl_il' ),
 148+ array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
 149+ array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
 150+ array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
 151+ ),
 152+ '1.16' => array(
 153+ array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
 154+ array( 'add_table', 'log_search', 'patch-log_search.sql' ),
 155+ array( 'do_log_search_population' ),
 156+ array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
 157+ array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
 158+ array( 'add_table', 'external_user', 'patch-external_user.sql' ),
 159+ array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
 160+ array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
 161+ array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
 162+ array( 'do_update_transcache_field' ),
 163+ array( 'rename_eu_wiki_id' ),
 164+ array( 'do_update_mime_minor_field' ),
 165+ array( 'do_populate_rev_len' ),
 166+ ),
 167+ '1.17' => array(
 168+ array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
 169+ array( 'add_index', 'iwlinks', 'iwl_prefix_from_title', 'patch-rename-iwl_prefix.sql' ),
 170+ array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' )
 171+ ),
 172+ );
 173+ }
 174+}
 175+
 176+/**
 177+ * Sqlite
 178+ */
 179+class SqliteUpdaters implements Updaters {
 180+ public function getUpdates() {
 181+ return array(
 182+ '1.14' => array(
 183+ array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
 184+ array( 'do_active_users_init' ),
 185+ array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
 186+ array( 'sqlite_initial_indexes' ),
 187+ ),
 188+ '1.15' => array(
 189+ array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
 190+ array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
 191+ array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
 192+ ),
 193+ '1.16' => array(
 194+ array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
 195+ array( 'add_table', 'log_search', 'patch-log_search.sql' ),
 196+ array( 'do_log_search_population' ),
 197+ array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
 198+ array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
 199+ array( 'add_table', 'external_user', 'patch-external_user.sql' ),
 200+ array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
 201+ array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
 202+ array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
 203+ array( 'do_update_transcache_field' ),
 204+ array( 'sqlite_setup_searchindex' ),
 205+ ),
 206+ '1.17' => array(
 207+ array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
 208+ array( 'add_index', 'iwlinks', 'iwl_prefix_from_title', 'patch-rename-iwl_prefix.sql' ),
 209+ array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
 210+ ),
 211+ );
 212+ }
 213+}
Property changes on: trunk/phase3/includes/installer/Updaters.php
___________________________________________________________________
Added: svn:eol-style
1214 + native
Index: trunk/phase3/includes/AutoLoader.php
@@ -421,9 +421,13 @@
422422 'WebInstaller' => 'includes/installer/WebInstaller.php',
423423 'WebInstallerOutput' => 'includes/installer/WebInstallerOutput.php',
424424 'MysqlInstaller' => 'includes/installer/MysqlInstaller.php',
 425+ 'MysqlUpdaters' => 'includes/installer/Updaters.php',
425426 'PostgresInstaller' => 'includes/installer/PostgresInstaller.php',
426427 'SqliteInstaller' => 'includes/installer/SqliteInstaller.php',
 428+ 'SqliteUpdaters' => 'includes/installer/Updaters.php',
427429 'OracleInstaller' => 'includes/installer/OracleInstaller.php',
 430+ 'Update' => 'includes/installer/Update.php',
 431+ 'Updaters' => 'includes/installer/Updaters.php',
428432
429433 # includes/job
430434 'DoubleRedirectJob' => 'includes/job/DoubleRedirectJob.php',

Follow-up revisions

RevisionCommit summaryAuthorDate
r69251Cleanup to r69187: forgot to safeguard against ul_value or updatelog itself n...demon12:31, 11 July 2010

Status & tagging log