本文整理汇总了PHP中AmazonS3::delete_all_objects方法的典型用法代码示例。如果您正苦于以下问题:PHP AmazonS3::delete_all_objects方法的具体用法?PHP AmazonS3::delete_all_objects怎么用?PHP AmazonS3::delete_all_objects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AmazonS3
的用法示例。
在下文中一共展示了AmazonS3::delete_all_objects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
/**
* {@inheritDoc}
*/
public function remove(array $paths, array $filters)
{
if (empty($paths) && empty($filters)) {
return;
}
if (empty($paths)) {
if (!$this->storage->delete_all_objects($this->bucket, sprintf('/%s/i', implode('|', $filters)))) {
$this->logError('The objects could not be deleted from Amazon S3.', array(
'filters' => implode(', ', $filters),
'bucket' => $this->bucket,
));
}
return;
}
foreach ($filters as $filter) {
foreach ($paths as $path) {
$objectPath = $this->getObjectPath($path, $filter);
if (!$this->objectExists($objectPath)) {
continue;
}
if (!$this->storage->delete_object($this->bucket, $objectPath)->isOK()) {
$this->logError('The objects could not be deleted from Amazon S3.', array(
'filter' => $filter,
'bucket' => $this->bucket,
'path' => $path,
));
}
}
}
}
示例2: tearDown
public function tearDown()
{
if ($this->instance) {
$s3 = new AmazonS3(array('key' => $this->config['amazons3']['key'], 'secret' => $this->config['amazons3']['secret']));
if ($s3->delete_all_objects($this->id)) {
$s3->delete_bucket($this->id);
}
}
}