$this->mOptions['verbose'] = 1;
}
- $this->verbose( 'Purging files that were: ' . implode( ', ', $typeList ) . "\n");
+ $this->verbose( 'Purging files that were: ' . implode( ', ', $typeList ) . "\n" );
foreach ( $typeList as $type ) {
$this->verbose( "Checking for {$type} files...\n" );
$this->purgeFromLogType( $type );
// Sanity check to avoid data loss
$repo->getBackend()->delete( array( 'src' => $file->getPath() ) );
$this->verbose( "Deleted orphan file: {$file->getPath()}.\n" );
-
} else {
$this->error( "File was not deleted: {$file->getPath()}.\n" );
}
// Purge items from fileachive table (rows are likely here)
$this->purgeFromArchiveTable( $repo, $file );
-
- } else if ( $logType === 'move' ) {
+ } elseif ( $logType === 'move' ) {
// Purge the target file as well
$params = unserialize( $row->log_params );
// Sanity check to avoid data loss
$repo->getBackend()->delete( array( 'src' => $ofile->getPath() ) );
$this->output( "Deleted orphan file: {$ofile->getPath()}.\n" );
-
} else {
$this->error( "File was not deleted: {$ofile->getPath()}.\n" );
}
protected function getDeletedPath( LocalRepo $repo, LocalFile $file ) {
$hash = $repo->getFileSha1( $file->getPath() );
$key = "{$hash}.{$file->getExtension()}";
+
return $repo->getDeletedHashPath( $key ) . $key;
}
$this->output( $msg );
}
}
-
}
$maintClass = "PurgeChangedFiles";