public function rmdir($path) { try { $this->statCache = array(); $content = $this->share->dir($this->buildPath($path)); foreach ($content as $file) { if ($file->isDirectory()) { $this->rmdir($path . '/' . $file->getName()); } else { $this->share->del($file->getPath()); } } $this->share->rmdir($this->buildPath($path)); return true; } catch (NotFoundException $e) { return false; } }
public function rmdir($path) { try { $this->statCache = array(); $content = $this->share->dir($this->buildPath($path)); foreach ($content as $file) { if ($file->isDirectory()) { $this->rmdir($path . '/' . $file->getName()); } else { $this->share->del($file->getPath()); } } $this->share->rmdir($this->buildPath($path)); return true; } catch (NotFoundException $e) { return false; } catch (ForbiddenException $e) { return false; } catch (ConnectException $e) { throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e); } }