From 2a2c644bbdb8579424694e906003286fb716aee1 Mon Sep 17 00:00:00 2001 From: Devang Srivastava Date: Thu, 7 Dec 2017 21:30:38 +0530 Subject: [PATCH] Update spaces.php --- spaces.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spaces.php b/spaces.php index b4cc370..06ae894 100644 --- a/spaces.php +++ b/spaces.php @@ -84,8 +84,16 @@ class SpacesConnect { return $this->space; } + function downloadSpaceToDirectory($pathToDirectory) { + $this->client->downloadBucket($pathToDirectory, $this->space); + } + 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->waitUntil('BucketNotExists', array('Bucket' => $this->space)); } @@ -154,9 +162,6 @@ class SpacesConnect { $this->client->uploadDirectory($directory, $this->space, $keyPrefix); } - function downloadSpaceToDirectory($pathToDirectory) { - $this->client->downloadBucket($pathToDirectory, $this->space); - }