Ejemplo n.º 1
0
 /**
  * Get an item from the storage service.
  *
  * @param  string $path
  * @param  array $options
  * @return mixed
  */
 public function fetchItem($path, $options = null)
 {
     $item = $this->_rackspace->getObject($this->_container, $path, $options);
     if (!$this->_rackspace->isSuccessful() && $this->_rackspace->getErrorCode() != '404') {
         throw new Zend_Cloud_StorageService_Exception('Error on fetch: ' . $this->_rackspace->getErrorMsg());
     }
     if (!empty($item)) {
         return $item->getContent();
     } else {
         return false;
     }
 }
Ejemplo n.º 2
0
 public function testGetObject()
 {
     $object = $this->rackspace->getObject('zf-unit-test', 'zf-object-test');
     $this->assertTrue($object !== false);
     $this->assertEquals($object->getName(), 'zf-object-test');
     $this->assertEquals($object->getSize(), 15);
     $this->assertEquals($object->getMetadata(), $this->metadata);
 }
Ejemplo n.º 3
0
 public function testGetObject()
 {
     $object = $this->rackspace->getObject(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME, TESTS_ZEND_SERVICE_RACKSPACE_OBJECT_NAME);
     $this->assertTrue($object !== false);
     $this->assertEquals($object->getName(), TESTS_ZEND_SERVICE_RACKSPACE_OBJECT_NAME);
 }