X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupAncientTables.php;h=694efaa64dfe378eb8b596aae31cdcbe5be2e375;hb=1e738d95b5339d157ad2c4f6f223ffbaeb1fa201;hp=dbc2e0d3d4e3bf61729b9dc3eceb6835af49108e;hpb=5aabfd92060989db57f8d968c7f9d7efe9a1ac26;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupAncientTables.php b/maintenance/cleanupAncientTables.php index dbc2e0d3d4..694efaa64d 100644 --- a/maintenance/cleanupAncientTables.php +++ b/maintenance/cleanupAncientTables.php @@ -21,7 +21,7 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script to cleans up old database tables, dropping old indexes @@ -38,7 +38,7 @@ class CleanupAncientTables extends Maintenance { } public function execute() { - if( !$this->hasOption( 'force' ) ) { + if ( !$this->hasOption( 'force' ) ) { $this->error( "This maintenance script will remove old columns and indexes.\n" . "It is recommended to backup your database first, and ensure all your data has been migrated to newer tables\n" . "If you want to continue, run this script again with the --force \n" @@ -61,7 +61,7 @@ class CleanupAncientTables extends Maintenance { 'validate', // 1.6 ); - foreach( $ancientTables as $table ) { + foreach ( $ancientTables as $table ) { if ( $db->tableExists( $table, __METHOD__ ) ) { $this->output( "Dropping table $table..." ); $db->dropTable( $table, __METHOD__ ); @@ -78,7 +78,7 @@ class CleanupAncientTables extends Maintenance { 'user_timestamp', 'usertext_timestamp', ); - foreach( $oldIndexes as $index ) { + foreach ( $oldIndexes as $index ) { if ( $db->indexExists( 'text', $index, __METHOD__ ) ) { $this->output( "Dropping index $index from the text table..." ); $db->query( "DROP INDEX " . $db->addIdentifierQuotes( $index ) @@ -97,7 +97,7 @@ class CleanupAncientTables extends Maintenance { 'old_minor_edit', 'inverse_timestamp', ); - foreach( $oldFields as $field ) { + foreach ( $oldFields as $field ) { if ( $db->fieldExists( 'text', $field, __METHOD__ ) ) { $this->output( "Dropping the $field field from the text table..." ); $db->query( "ALTER TABLE " . $db->tableName( 'text' ) @@ -110,4 +110,4 @@ class CleanupAncientTables extends Maintenance { } $maintClass = "CleanupAncientTables"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;