Skip to content

Commit

Permalink
Merge pull request #34 from cp6/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
cp6 authored May 1, 2024
2 parents 139a455 + e598200 commit 4ca32cd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/BunnyAPIStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ public function folderExists(string $path): bool

public function createFolder(string $name): array
{
if (ftp_mkdir($this->connection, $name)) {
return array('response' => 'success', 'action' => __FUNCTION__, 'value' => $name);
if (@!ftp_chdir($this->connection, $name)) {
if (ftp_mkdir($this->connection, $name)) {
return array('response' => 'success', 'action' => __FUNCTION__, 'value' => $name);
}
return array('response' => 'fail', 'action' => __FUNCTION__, 'value' => $name, 'message' => "Failed to create directory $name");
}
return array('response' => 'fail', 'action' => __FUNCTION__, 'value' => $name);
return array('response' => 'fail', 'action' => __FUNCTION__, 'value' => $name, 'message' => "Directory $name already exists");
}

public function deleteFolder(string $name): array
Expand Down

0 comments on commit 4ca32cd

Please sign in to comment.