/** * Delete a directory * * @param string $dirname * @return boolean */ public function deleteDir($dirname) { $paths = array(); $prefix = '/' . $this->container->getName() . '/'; $objects = $this->container->objectList(array('prefix' => $dirname)); foreach ($objects as $object) { $paths[] = $prefix . ltrim($object->getName(), '/'); } $service = $this->container->getService(); $response = $service->bulkDelete($paths); if ($response->getStatusCode() === 200) { return true; } return false; }
/** * @return \Guzzle\Http\ClientInterface */ private function getClient() { return $this->newContainer->getService()->getClient(); }