/** * Delete an item in the storage service. * * @param string $path * @param array $options * @return void */ public function deleteItem($path, $options = null) { $this->_rackspace->deleteObject($this->_container, $path); if (!$this->_rackspace->isSuccessful()) { throw new Zend_Cloud_StorageService_Exception('Error on delete: ' . $this->_rackspace->getErrorMsg()); } }
/** * Delete an object. * * @param string $file * @return boolean */ public function deleteObject($file, $container = false) { if (!$container) { $container = $this->getGeneralContainer(); } $this->_service->deleteObject($container, $file); return $this->_service->isSuccessful(); }
/** * Tears down this test case * * @return void */ public function tearDown() { if (!$this->_config) { return; } // Delete the container here $rackspace = new Zend_Service_Rackspace_Files($this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::USER), $this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::API_KEY)); $files = $rackspace->getObjects($this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::REMOTE_CONTAINER)); if ($files == !false) { foreach ($files as $file) { $rackspace->deleteObject($this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::REMOTE_CONTAINER), $file->getName()); } } $rackspace->deleteContainer($this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::REMOTE_CONTAINER)); parent::tearDown(); }
public function testDeleteObject2() { $this->assertTrue($this->rackspace->deleteObject(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME, TESTS_ZEND_SERVICE_RACKSPACE_OBJECT_NAME . '-copy')); }
public function testDeleteObject2() { $this->assertTrue($this->rackspace->deleteObject('zf-unit-test', 'zf-object-test' . '-copy')); }