use FileRepo api to delete and check for files
authorJan Gerber <j@thing.net>
Thu, 19 Jul 2012 20:29:11 +0000 (20:29 +0000)
committerJan Gerber <j@thing.net>
Thu, 19 Jul 2012 20:31:24 +0000 (20:31 +0000)
instead of direct file access use FileRepo api,
this way the script works for remote backends too.

Change-Id: I08c29cec4bc685c422630487b91458d13184fe94

maintenance/deleteArchivedFiles.inc

index 728997d..e638b17 100644 (file)
@@ -50,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 {