mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-31 03:50:40 -07:00
Recursive option added for deleting folder objects
This commit is contained in:
parent
12b4f6a627
commit
267ba3e4a6
2 changed files with 21 additions and 6 deletions
|
@ -238,8 +238,12 @@ class SpacesConnect {
|
|||
/*
|
||||
Deletes an object.
|
||||
*/
|
||||
function DeleteObject($file_path = "") {
|
||||
function DeleteObject($file_path = "", $recursive = false) {
|
||||
try {
|
||||
if ($recursive) return $this->ObjReturn($this->client->deleteMatchingObjects(
|
||||
$this->space,
|
||||
$file_path
|
||||
));
|
||||
return $this->ObjReturn($this->client->deleteObject([
|
||||
'Bucket' => $this->space,
|
||||
'Key' => $file_path,
|
||||
|
@ -284,7 +288,7 @@ class SpacesConnect {
|
|||
}
|
||||
catch (\Exception $e) {
|
||||
$this->HandleAWSException($e);
|
||||
} finally {
|
||||
} finally {
|
||||
if ($is_file) {
|
||||
fclose($file);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue