From: Antoine Musso Date: Sat, 12 May 2007 17:56:09 +0000 (+0000) Subject: svn:eol-style native X-Git-Tag: 1.31.0-rc.0~52935 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=9288ab2f4855b4e164137c0dacfbbdf3d9cd7de8;p=lhc%2Fweb%2Fwiklou.git svn:eol-style native --- diff --git a/maintenance/deleteArchivedFiles.inc b/maintenance/deleteArchivedFiles.inc index 7ac5f3a3bd..e98a1b4726 100644 --- a/maintenance/deleteArchivedFiles.inc +++ b/maintenance/deleteArchivedFiles.inc @@ -1,57 +1,57 @@ -begin(); - - $transaction = new FSTransaction(); - if( !FileStore::lock() ) { - wfDebug( __METHOD__.": failed to acquire file store lock, aborting\n" ); - return false; - } - - $tbl_arch = $dbw->tableName( 'filearchive' ); - - # Get "active" revisions from the filearchive table - echo( "Searching for and deleting archived files...\n" ); - $res = $dbw->query( "SELECT fa_id,fa_storage_group,fa_storage_key FROM $tbl_arch" ); - while( $row = $dbw->fetchObject( $res ) ) { - $key = $row->fa_storage_key; - $group = $row->fa_storage_group; - $id = $row->fa_id; - - $store = FileStore::get( $group ); - if ( $store ) { - $path = $store->filePath( $key ); - if ( $path && file_exists($path) ) { - $transaction->addCommit( FSTransaction::DELETE_FILE, $path ); - $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" ); - } else { - echo( "Notice - file '$key' not found in group '$group'\n" ); - } - } else { - echo( "Notice - invalid file storage group '$group'\n" ); - } - } - echo( "done.\n" ); - - $transaction->commit(); - - # This bit's done - # Purge redundant text records - $dbw->commit(); - -} - +begin(); + + $transaction = new FSTransaction(); + if( !FileStore::lock() ) { + wfDebug( __METHOD__.": failed to acquire file store lock, aborting\n" ); + return false; + } + + $tbl_arch = $dbw->tableName( 'filearchive' ); + + # Get "active" revisions from the filearchive table + echo( "Searching for and deleting archived files...\n" ); + $res = $dbw->query( "SELECT fa_id,fa_storage_group,fa_storage_key FROM $tbl_arch" ); + while( $row = $dbw->fetchObject( $res ) ) { + $key = $row->fa_storage_key; + $group = $row->fa_storage_group; + $id = $row->fa_id; + + $store = FileStore::get( $group ); + if ( $store ) { + $path = $store->filePath( $key ); + if ( $path && file_exists($path) ) { + $transaction->addCommit( FSTransaction::DELETE_FILE, $path ); + $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" ); + } else { + echo( "Notice - file '$key' not found in group '$group'\n" ); + } + } else { + echo( "Notice - invalid file storage group '$group'\n" ); + } + } + echo( "done.\n" ); + + $transaction->commit(); + + # This bit's done + # Purge redundant text records + $dbw->commit(); + +} + ?> \ No newline at end of file diff --git a/maintenance/deleteArchivedFiles.php b/maintenance/deleteArchivedFiles.php index 7aee527e81..0b5a03ce0a 100644 --- a/maintenance/deleteArchivedFiles.php +++ b/maintenance/deleteArchivedFiles.php @@ -1,31 +1,31 @@ - \ No newline at end of file diff --git a/maintenance/deleteArchivedRevisions.inc b/maintenance/deleteArchivedRevisions.inc index 8d89badc79..f820ccb044 100644 --- a/maintenance/deleteArchivedRevisions.inc +++ b/maintenance/deleteArchivedRevisions.inc @@ -1,35 +1,35 @@ -begin(); - - $tbl_arch = $dbw->tableName( 'archive' ); - # Delete as appropriate - echo( "Deleting archived revisions..." ); - $dbw->query( "TRUNCATE TABLE $tbl_arch" ); - echo( "done.\n" ); - - $delete = $dbw->affectedRows() != 0; - - # This bit's done - # Purge redundant text records - $dbw->commit(); - if( $delete ) { - PurgeRedundantText( true ); - } - -} - +begin(); + + $tbl_arch = $dbw->tableName( 'archive' ); + # Delete as appropriate + echo( "Deleting archived revisions..." ); + $dbw->query( "TRUNCATE TABLE $tbl_arch" ); + echo( "done.\n" ); + + $delete = $dbw->affectedRows() != 0; + + # This bit's done + # Purge redundant text records + $dbw->commit(); + if( $delete ) { + PurgeRedundantText( true ); + } + +} + ?> \ No newline at end of file diff --git a/maintenance/deleteArchivedRevisions.php b/maintenance/deleteArchivedRevisions.php index 26cc5ca044..20bc934cd7 100644 --- a/maintenance/deleteArchivedRevisions.php +++ b/maintenance/deleteArchivedRevisions.php @@ -1,31 +1,31 @@ - \ No newline at end of file