X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupAncientTables.php;h=bcf4af2186798233132ac7088af2fa8bc42b1f79;hb=62991fcb7a5027b1eceb5656829c1c65bf9f98cb;hp=f1467d5ffcd5a279896e5142bdcd622341cb715a;hpb=23299ca8790bcf1aebcf54e0932b94338e630474;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupAncientTables.php b/maintenance/cleanupAncientTables.php index f1467d5ffc..bcf4af2186 100644 --- a/maintenance/cleanupAncientTables.php +++ b/maintenance/cleanupAncientTables.php @@ -33,7 +33,7 @@ class CleanupAncientTables extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Cleanup ancient tables and indexes"; + $this->addDescription( 'Cleanup ancient tables and indexes' ); $this->addOption( 'force', 'Actually run this script' ); } @@ -47,7 +47,7 @@ class CleanupAncientTables extends Maintenance { } $db = $this->getDB( DB_MASTER ); - $ancientTables = array( + $ancientTables = [ 'blobs', // 1.4 'brokenlinks', // 1.4 'cur', // 1.4 @@ -60,7 +60,7 @@ class CleanupAncientTables extends Maintenance { 'trackback', // 1.19 'user_rights', // 1.5 'validate', // 1.6 - ); + ]; foreach ( $ancientTables as $table ) { if ( $db->tableExists( $table, __METHOD__ ) ) { @@ -72,13 +72,13 @@ class CleanupAncientTables extends Maintenance { $this->output( "Cleaning up text table\n" ); - $oldIndexes = array( + $oldIndexes = [ 'old_namespace', 'old_timestamp', 'name_title_timestamp', 'user_timestamp', 'usertext_timestamp', - ); + ]; foreach ( $oldIndexes as $index ) { if ( $db->indexExists( 'text', $index, __METHOD__ ) ) { $this->output( "Dropping index $index from the text table..." ); @@ -88,7 +88,7 @@ class CleanupAncientTables extends Maintenance { } } - $oldFields = array( + $oldFields = [ 'old_namespace', 'old_title', 'old_comment', @@ -97,7 +97,7 @@ class CleanupAncientTables extends Maintenance { 'old_timestamp', 'old_minor_edit', 'inverse_timestamp', - ); + ]; foreach ( $oldFields as $field ) { if ( $db->fieldExists( 'text', $field, __METHOD__ ) ) { $this->output( "Dropping the $field field from the text table..." ); @@ -110,5 +110,5 @@ class CleanupAncientTables extends Maintenance { } } -$maintClass = "CleanupAncientTables"; +$maintClass = CleanupAncientTables::class; require_once RUN_MAINTENANCE_IF_MAIN;