r78043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78042‎ | r78043 | r78044 >
Date:03:47, 8 December 2010
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Added array type hint to addExtensionUpdate and marked some functions "protected"
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -118,7 +118,7 @@
119119 * Note that callback functions will recieve this object as
120120 * first parameter.
121121 */
122 - public function addExtensionUpdate( $update ) {
 122+ public function addExtensionUpdate( Array $update ) {
123123 $this->extensionUpdates[] = $update;
124124 }
125125
@@ -331,7 +331,7 @@
332332 * @param $patch String Path to the patch file
333333 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
334334 */
335 - function addIndex( $table, $index, $patch, $fullpath = false ) {
 335+ protected function addIndex( $table, $index, $patch, $fullpath = false ) {
336336 if ( $this->db->indexExists( $table, $index ) ) {
337337 $this->output( "...$index key already set on $table table.\n" );
338338 } else {
@@ -349,7 +349,7 @@
350350 * @param $patch String Path to the patch file
351351 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
352352 */
353 - function dropField( $table, $field, $patch, $fullpath = false ) {
 353+ protected function dropField( $table, $field, $patch, $fullpath = false ) {
354354 if ( $this->db->fieldExists( $table, $field ) ) {
355355 $this->output( "Table $table contains $field field. Dropping... " );
356356 $this->applyPatch( $patch, $fullpath );
@@ -367,7 +367,7 @@
368368 * @param $patch String: Path to the patch file
369369 * @param $fullpath Boolean: Whether to treat $patch path as a relative or not
370370 */
371 - function dropIndex( $table, $index, $patch, $fullpath = false ) {
 371+ protected function dropIndex( $table, $index, $patch, $fullpath = false ) {
372372 if ( $this->db->indexExists( $table, $index ) ) {
373373 $this->output( "Dropping $index from table $table... " );
374374 $this->applyPatch( $patch, $fullpath );
@@ -457,7 +457,7 @@
458458 $this->output( "Done populating log_search table.\n" );
459459 }
460460
461 - function doUpdateTranscacheField() {
 461+ protected function doUpdateTranscacheField() {
462462 if ( $this->updateRowExists( 'convert transcache field' ) ) {
463463 $this->output( "...transcache tc_time already converted.\n" );
464464 return;

Follow-up revisions

RevisionCommit summaryAuthorDate
r801901.17: MFT first batch of installer changes: r78043, r78231, r78259, r78300, r...catrope20:47, 13 January 2011

Comments

#Comment by Catrope (talk | contribs)   21:20, 8 December 2010

Untagged 1.17, this hardly seems necessary. Chad, any specific reason you tagged it?

#Comment by 😂 (talk | contribs)   21:55, 12 January 2011

Consistency? Makes merging dependent revs easier (if any)?

#Comment by Catrope (talk | contribs)   21:57, 12 January 2011

Right, it's in the installer. Never mind.

#Comment by Hashar (talk | contribs)   14:22, 11 December 2010

marking 'fixme', seems to break continuous integration build:

http://ci.tesla.usability.wikimedia.org/cruisecontrol/buildresults/mw?log=log20101208043141

PHP Warning:  fopen(/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/maintenance/archives//home/ci/cruisecontrol-bin-2.8.3/projects/mw/extensions/FlaggedRevs/FlaggedRevs.sql): \
failed to open stream: No such file or directory in /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/db/Database.php on line 2401
PHP Stack trace:
PHP   1. {main}() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/maintenance/update.php:0
PHP   2. require_once() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/maintenance/update.php:119
PHP   3. UpdateMediaWiki->execute() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/maintenance/doMaintenance.php:105
PHP   4. DatabaseUpdater->doUpdates() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/maintenance/update.php:93
PHP   5. DatabaseUpdater->runUpdates() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/installer/DatabaseUpdater.php:152
PHP   6. call_user_func_array() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/installer/DatabaseUpdater.php:177
PHP   7. DatabaseUpdater->addTable() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/installer/DatabaseUpdater.php:0
PHP   8. DatabaseUpdater->applyPatch() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/installer/DatabaseUpdater.php:303
PHP   9. DatabaseBase->sourceFile() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/installer/DatabaseUpdater.php:288
PHP  10. fopen() /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/db/Database.php:2401
#Comment by IAlex (talk | contribs)   15:03, 11 December 2010

This is related to r78042, not this one, changing back to "new".

#Comment by Hashar (talk | contribs)   09:40, 12 December 2010

Thanks ialex !

Status & tagging log