本文整理汇总了PHP中AmazonS3::delete_bucket方法的典型用法代码示例。如果您正苦于以下问题:PHP AmazonS3::delete_bucket方法的具体用法?PHP AmazonS3::delete_bucket怎么用?PHP AmazonS3::delete_bucket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AmazonS3
的用法示例。
在下文中一共展示了AmazonS3::delete_bucket方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
}
示例2: deleteBucket
public static function deleteBucket($app)
{
$user_storage_s3 = Doctrine::getTable('GcrUserStorageS3')->findOneByAppId($app->getShortName());
if ($user_storage_s3) {
$account = GcrUserStorageS3Table::getAccount($app);
define('AWS_KEY', $account->getAccessKeyId());
define('AWS_SECRET_KEY', $account->getSecretAccessKey());
gcr::loadSdk('aws');
$api = new AmazonS3();
$api->delete_bucket($user_storage_s3->getBucketName(), true);
$user_storage_s3->delete();
}
}
示例3: execute
protected function execute($arguments = array(), $options = array())
{
$this->configuration = ProjectConfiguration::getApplicationConfiguration($options['app'], $options['env'], true);
if (!sfConfig::get('app_sf_amazon_plugin_access_key', false)) {
throw new sfException(sprintf('You have not set an amazon access key'));
}
if (!sfConfig::get('app_sf_amazon_plugin_secret_key', false)) {
throw new sfException(sprintf('You have not set an amazon secret key'));
}
$s3 = new AmazonS3(sfConfig::get('app_sf_amazon_plugin_access_key'), sfConfig::get('app_sf_amazon_plugin_secret_key'));
$response = $s3->delete_bucket($arguments['bucket'], $options['force']);
if ($response->isOk()) {
$this->logSection('Bucket-', sprintf('"%s" bucket has been deleted', $arguments['bucket']));
} else {
throw new sfException($this->body->Message);
}
}
示例4: deleteAmazonBucket
public function deleteAmazonBucket($name)
{
ProjectConfiguration::registerAws();
$s3 = new AmazonS3();
if ($s3->if_bucket_exists($name)) {
return $s3->delete_bucket($name, true);
}
}