summaryrefslogtreecommitdiff
path: root/maintenance/deleteArchivedFiles.inc
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/deleteArchivedFiles.inc')
-rw-r--r--maintenance/deleteArchivedFiles.inc16
1 files changed, 11 insertions, 5 deletions
diff --git a/maintenance/deleteArchivedFiles.inc b/maintenance/deleteArchivedFiles.inc
index 68394b4a..e638b17c 100644
--- a/maintenance/deleteArchivedFiles.inc
+++ b/maintenance/deleteArchivedFiles.inc
@@ -17,14 +17,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
+/**
+ * Core functions for deleteArchivedFiles.php
+ *
+ * @ingroup Maintenance
+ */
class DeleteArchivedFilesImplementation {
static public function doDelete( $output, $force ) {
# Data should come off the master, wrapped in a transaction
$dbw = wfGetDB( DB_MASTER );
- $dbw->begin();
+ $dbw->begin( __METHOD__ );
$tbl_arch = $dbw->tableName( 'filearchive' );
$repo = RepoGroup::singleton()->getLocalRepo();
# Get "active" revisions from the filearchive table
@@ -44,8 +50,8 @@ class DeleteArchivedFilesImplementation {
__METHOD__,
array( 'FOR UPDATE' )
);
- if ( $path && file_exists( $path ) && !$inuse ) {
- if( unlink( $path ) ) { // delete
+ if ( $path && $repo->fileExists( $path ) && !$inuse ) {
+ if ( $repo->quickPurge( $path ) ) {
$count++;
$dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" );
} else {
@@ -59,7 +65,7 @@ class DeleteArchivedFilesImplementation {
}
}
}
- $dbw->commit();
+ $dbw->commit( __METHOD__ );
$output->handleOutput( "Done! [$count file(s)]\n" );
}
-} \ No newline at end of file
+}