Index: trunk/phase3/maintenance/deleteArchivedFiles.php |
— | — | @@ -37,6 +37,10 @@ |
38 | 38 | $this->output( "Use --delete to actually confirm this script\n" ); |
39 | 39 | return; |
40 | 40 | } |
| 41 | + $force = false; |
| 42 | + if( $this->hasOption('force') ) { |
| 43 | + $force = true; |
| 44 | + } |
41 | 45 | # Data should come off the master, wrapped in a transaction |
42 | 46 | $dbw = wfGetDB( DB_MASTER ); |
43 | 47 | $dbw->begin(); |
— | — | @@ -65,6 +69,10 @@ |
66 | 70 | $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" ); |
67 | 71 | } else { |
68 | 72 | $this->output( "Notice - file '$key' not found in group '$group'\n" ); |
| 73 | + if ( $force ) { |
| 74 | + $this->output( "Got --force, deleting DB entry\n" ); |
| 75 | + $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" ); |
| 76 | + } |
69 | 77 | } |
70 | 78 | } |
71 | 79 | $dbw->commit(); |