Exemplo n.º 1
0
 /**
  * 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 Exception\RuntimeException('Error on delete: ' . $this->rackspace->getErrorMsg());
     }
 }
Exemplo n.º 2
0
 /**
  * Tears down this test case
  *
  * @return void
  */
 public function tearDown()
 {
     if (!$this->_config) {
         return;
     }
     // Delete the container here
     $rackspace = new RackspaceService($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();
 }
Exemplo n.º 3
0
 /**
  * Delete an object in the container
  *
  * @param string $obj
  * @return boolean
  */
 public function deleteObject($obj)
 {
     return $this->service->deleteObject($this->getName(), $obj);
 }
Exemplo n.º 4
0
 public function testDeleteObject2()
 {
     $this->assertTrue($this->rackspace->deleteObject(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME, TESTS_ZEND_SERVICE_RACKSPACE_OBJECT_NAME . '-copy'));
 }