Update spaces.php

This commit is contained in:
Devang Srivastava 2017-12-07 21:30:38 +05:30 committed by GitHub
commit 2a2c644bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,8 +84,16 @@ class SpacesConnect {
return $this->space; return $this->space;
} }
function downloadSpaceToDirectory($pathToDirectory) {
$this->client->downloadBucket($pathToDirectory, $this->space);
}
function destroyThisSpace() { function destroyThisSpace() {
$this->setSpace(NULL); $objects = $this->listObjects();
foreach ($objects as $value) {
$key = $value["Key"];
$this->deleteObject($key);
}
$this->client->deleteBucket(array('Bucket' => $this->space)); $this->client->deleteBucket(array('Bucket' => $this->space));
$this->client->waitUntil('BucketNotExists', array('Bucket' => $this->space)); $this->client->waitUntil('BucketNotExists', array('Bucket' => $this->space));
} }
@ -154,9 +162,6 @@ class SpacesConnect {
$this->client->uploadDirectory($directory, $this->space, $keyPrefix); $this->client->uploadDirectory($directory, $this->space, $keyPrefix);
} }
function downloadSpaceToDirectory($pathToDirectory) {
$this->client->downloadBucket($pathToDirectory, $this->space);
}