diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /maintenance/deleteArchivedFiles.inc | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'maintenance/deleteArchivedFiles.inc')
-rw-r--r-- | maintenance/deleteArchivedFiles.inc | 16 |
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 +} |