From: Jan Gerber Date: Thu, 19 Jul 2012 20:29:11 +0000 (+0000) Subject: use FileRepo api to delete and check for files X-Git-Tag: 1.31.0-rc.0~22855^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=24b76af3a83408039f4138a78d70efdb6b986998;p=lhc%2Fweb%2Fwiklou.git use FileRepo api to delete and check for files instead of direct file access use FileRepo api, this way the script works for remote backends too. Change-Id: I08c29cec4bc685c422630487b91458d13184fe94 --- diff --git a/maintenance/deleteArchivedFiles.inc b/maintenance/deleteArchivedFiles.inc index 728997d081..e638b17cb4 100644 --- a/maintenance/deleteArchivedFiles.inc +++ b/maintenance/deleteArchivedFiles.inc @@ -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 {