* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to remove old or broken uploads from temporary uploaded
} else {
// finish the read before starting writes.
$keys = array();
- foreach( $res as $row ) {
+ foreach ( $res as $row ) {
array_push( $keys, $row->us_key );
}
$stash = new UploadStash( $repo );
$i = 0;
- foreach( $keys as $key ) {
+ foreach ( $keys as $key ) {
$i++;
try {
$stash->getFile( $key, true );
$stash->removeFileNoAuth( $key );
} catch ( UploadStashBadPathException $ex ) {
- $this->output( "Failed removing stashed upload with key: $key\n" );
+ $this->output( "Failed removing stashed upload with key: $key\n" );
} catch ( UploadStashZeroLengthFileException $ex ) {
- $this->output( "Failed removing stashed upload with key: $key\n" );
+ $this->output( "Failed removing stashed upload with key: $key\n" );
}
if ( $i % 100 == 0 ) {
$this->output( "$i\n" );
}
// Delete all the corresponding thumbnails...
- $dir = $tempRepo->getZonePath( 'thumb' );
+ $dir = $tempRepo->getZonePath( 'thumb' );
$iterator = $tempRepo->getBackend()->getFileList( array( 'dir' => $dir ) );
$this->output( "Deleting old thumbnails...\n" );
$i = 0;
$this->output( "$i done\n" );
// Apparently lots of stash files are not registered in the DB...
- $dir = $tempRepo->getZonePath( 'public' );
+ $dir = $tempRepo->getZonePath( 'public' );
$iterator = $tempRepo->getBackend()->getFileList( array( 'dir' => $dir ) );
$this->output( "Deleting orphaned temp files...\n" );
if ( strpos( $dir, '/local-temp' ) === false ) { // sanity check
}
$maintClass = "UploadStashCleanup";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;