r102684 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102683‎ | r102684 | r102685 >
Date:20:44, 10 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Pass in some more , __METHOD__
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/SqliteUpdater.php (modified) (history)
  • /trunk/phase3/maintenance/convertUserOptions.php (modified) (history)
  • /trunk/phase3/maintenance/rebuildtextindex.php (modified) (history)
  • /trunk/phase3/tests/testHelpers.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/rebuildtextindex.php
@@ -112,7 +112,7 @@
113113 */
114114 private function dropMysqlTextIndex() {
115115 $searchindex = $this->db->tableName( 'searchindex' );
116 - if ( $this->db->indexExists( 'searchindex', 'si_title' ) ) {
 116+ if ( $this->db->indexExists( 'searchindex', 'si_title', __METHOD__ ) ) {
117117 $this->output( "Dropping index...\n" );
118118 $sql = "ALTER TABLE $searchindex DROP INDEX si_title, DROP INDEX si_text";
119119 $this->db->query( $sql, __METHOD__ );
Index: trunk/phase3/maintenance/convertUserOptions.php
@@ -37,7 +37,7 @@
3838 $id = 0;
3939 $dbw = wfGetDB( DB_MASTER );
4040
41 - if ( !$dbw->fieldExists( 'user', 'user_options ' ) ) {
 41+ if ( !$dbw->fieldExists( 'user', 'user_options', __METHOD__ ) ) {
4242 $this->output( "No user_options field in the user table. Nothing to migrate..." );
4343 return;
4444 }
Index: trunk/phase3/tests/testHelpers.inc
@@ -121,8 +121,8 @@
122122 function start() {
123123 parent::start();
124124
125 - if ( ! $this->db->tableExists( 'testrun' )
126 - or ! $this->db->tableExists( 'testitem' ) )
 125+ if ( ! $this->db->tableExists( 'testrun', __METHOD__ )
 126+ || ! $this->db->tableExists( 'testitem', __METHOD__ ) )
127127 {
128128 print "WARNING> `testrun` table not found in database.\n";
129129 $this->prevRun = false;
@@ -305,7 +305,7 @@
306306 $this->db->begin();
307307
308308 if ( ! $this->db->tableExists( 'testrun' )
309 - or ! $this->db->tableExists( 'testitem' ) )
 309+ || ! $this->db->tableExists( 'testitem' ) )
310310 {
311311 print "WARNING> `testrun` table not found in database. Trying to create table.\n";
312312 $this->db->sourceFile( $this->db->patchPath( 'patch-testrun.sql' ) );
Index: trunk/phase3/includes/installer/SqliteUpdater.php
@@ -73,7 +73,7 @@
7474
7575 protected function sqliteInitialIndexes() {
7676 // initial-indexes.sql fails if the indexes are already present, so we perform a quick check if our database is newer.
77 - if ( $this->updateRowExists( 'initial_indexes' ) || $this->db->indexExists( 'user', 'user_name' ) ) {
 77+ if ( $this->updateRowExists( 'initial_indexes' ) || $this->db->indexExists( 'user', 'user_name', __METHOD__ ) ) {
7878 $this->output( "...have initial indexes\n" );
7979 return;
8080 }
Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -316,7 +316,7 @@
317317 */
318318 protected function canUseNewUpdatelog() {
319319 return $this->db->tableExists( 'updatelog', __METHOD__ ) &&
320 - $this->db->fieldExists( 'updatelog', 'ul_value' );
 320+ $this->db->fieldExists( 'updatelog', 'ul_value', __METHOD__ );
321321 }
322322
323323 /**
@@ -418,7 +418,7 @@
419419 protected function addField( $table, $field, $patch, $fullpath = false ) {
420420 if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
421421 $this->output( "...$table table does not exist, skipping new field patch\n" );
422 - } elseif ( $this->db->fieldExists( $table, $field ) ) {
 422+ } elseif ( $this->db->fieldExists( $table, $field, __METHOD__ ) ) {
423423 $this->output( "...have $field field in $table table.\n" );
424424 } else {
425425 $this->output( "Adding $field field to table $table..." );
@@ -435,7 +435,7 @@
436436 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
437437 */
438438 protected function addIndex( $table, $index, $patch, $fullpath = false ) {
439 - if ( $this->db->indexExists( $table, $index ) ) {
 439+ if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
440440 $this->output( "...$index key already set on $table table.\n" );
441441 } else {
442442 $this->output( "Adding $index key to table $table... " );
@@ -453,7 +453,7 @@
454454 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
455455 */
456456 protected function dropField( $table, $field, $patch, $fullpath = false ) {
457 - if ( $this->db->fieldExists( $table, $field ) ) {
 457+ if ( $this->db->fieldExists( $table, $field, __METHOD__ ) ) {
458458 $this->output( "Table $table contains $field field. Dropping... " );
459459 $this->applyPatch( $patch, $fullpath );
460460 $this->output( "ok\n" );
@@ -471,7 +471,7 @@
472472 * @param $fullpath Boolean: Whether to treat $patch path as a relative or not
473473 */
474474 protected function dropIndex( $table, $index, $patch, $fullpath = false ) {
475 - if ( $this->db->indexExists( $table, $index ) ) {
 475+ if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
476476 $this->output( "Dropping $index key from table $table... " );
477477 $this->applyPatch( $patch, $fullpath );
478478 $this->output( "ok\n" );
@@ -507,7 +507,7 @@
508508 $updateKey = "$table-$field-$patch";
509509 if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
510510 $this->output( "...$table table does not exist, skipping modify field patch\n" );
511 - } elseif ( !$this->db->fieldExists( $table, $field ) ) {
 511+ } elseif ( !$this->db->fieldExists( $table, $field, __METHOD__ ) ) {
512512 $this->output( "...$field field does not exist in $table table, skipping modify field patch\n" );
513513 } elseif( $this->updateRowExists( $updateKey ) ) {
514514 $this->output( "...$field in table $table already modified by patch $patch\n" );
Index: trunk/phase3/includes/installer/MysqlUpdater.php
@@ -583,7 +583,7 @@
584584 $this->output( "ok\n" );
585585
586586 if ( !$this->db->tableExists( 'user_rights', __METHOD__ ) ) {
587 - if ( $this->db->fieldExists( 'user', 'user_rights' ) ) {
 587+ if ( $this->db->fieldExists( 'user', 'user_rights', __METHOD__ ) ) {
588588 $this->output( "Upgrading from a 1.3 or older database? Breaking out user_rights for conversion..." );
589589 $this->db->applyPatch( 'patch-user_rights.sql' );
590590 $this->output( "ok\n" );
@@ -762,7 +762,7 @@
763763 protected function doMaybeProfilingMemoryUpdate() {
764764 if ( !$this->db->tableExists( 'profiling', __METHOD__ ) ) {
765765 // Simply ignore
766 - } elseif ( $this->db->fieldExists( 'profiling', 'pf_memory' ) ) {
 766+ } elseif ( $this->db->fieldExists( 'profiling', 'pf_memory', __METHOD__ ) ) {
767767 $this->output( "...profiling table has pf_memory field.\n" );
768768 } else {
769769 $this->output( "Adding pf_memory field to table profiling..." );
@@ -793,7 +793,7 @@
794794 }
795795
796796 protected function renameEuWikiId() {
797 - if ( $this->db->fieldExists( 'external_user', 'eu_local_id' ) ) {
 797+ if ( $this->db->fieldExists( 'external_user', 'eu_local_id', __METHOD__ ) ) {
798798 $this->output( "...eu_wiki_id already renamed to eu_local_id.\n" );
799799 return;
800800 }

Status & tagging log