Webiny\Component\Amazon\S3::deleteObject PHP Method

deleteObject() public method

If there isn't a null version, Amazon S3 does not remove any objects.
public deleteObject ( string $bucket, string $key, array $params = [] ) : mixed
$bucket string
$key string
$params array
return mixed
    public function deleteObject($bucket, $key, array $params = [])
    {
        return $this->instance->deleteObject($bucket, $key, $params);
    }

Usage Example

コード例 #1
0
ファイル: AmazonS3Test.php プロジェクト: Nkelliny/Framework
 /**
  * @dataProvider driverSet
  */
 public function testAmazon(S3 $S3)
 {
     $S3->createBucket($this->bucket);
     $this->assertTrue($S3->doesBucketExist($this->bucket));
     $S3->putObject($this->bucket, $this->key, 'Component test');
     $this->assertTrue($S3->doesObjectExist($this->bucket, $this->key));
     $this->assertSame('Component test', (string) $S3->getObject($this->bucket, $this->key)['Body']);
     $S3->deleteObject($this->bucket, $this->key);
     $this->assertFalse($S3->doesObjectExist($this->bucket, $this->key));
     $S3->deleteBucket($this->bucket);
     $this->assertFalse($S3->doesBucketExist($this->bucket));
 }
All Usage Examples Of Webiny\Component\Amazon\S3::deleteObject