public function flushBucketCommand($bucket)
    {
        try {
            $s3Client = new S3Client($this->s3DefaultProfile);
            $batchDelete = BatchDelete::fromListObjects($s3Client, ['Bucket' => $bucket]);
            $promise = $batchDelete->promise();
        } catch (\Exception $e) {
            $this->outputLine($e->getMessage());
            $this->quit(1);
            exit;
        }
        $promise->wait();
        $this->outputLine('Successfully flushed bucket %s.', array($bucket));
    }
public function flushBucketCommand($bucket)
    {
        try {
            $s3Client = new S3Client($this->s3DefaultProfile);
            $batchDelete = BatchDelete::fromListObjects($s3Client, ['Bucket' => $bucket]);
            $promise = $batchDelete->promise();
        } catch (\Exception $e) {
            $this->outputLine($e->getMessage());
            $this->quit(1);
            exit;
        }
        $promise->wait();
        $this->outputLine('Successfully flushed bucket %s.', array($bucket));
    }
public function flushBucketCommand ( $ bucket ) { try { $ s3Client = new S3Client ( $ this -> s3DefaultProfile ) ; $ batchDelete = BatchDelete :: fromListObjects ( $ s3Client , [ 'Bucket' => $ bucket ] ) ; $ promise = $ batchDelete -> promise ( ) ; } catch ( \ Exception $ e ) { $ this -> outputLine ( $ e -> getMessage ( ) ) ; $ this -> quit ( 1 ) ; exit ; } $ promise -> wait ( ) ; $ this -> outputLine ( 'Successfully flushed bucket %s.' , array ( $ bucket ) ) ; }
Removes all objects from a bucket

This command deletes all objects (files) of the given bucket.

@param string $bucket Name of the bucket
@return void
Removes all objects from a bucket