コード例 #1
0
ファイル: Rackspace.php プロジェクト: brikou/zend_cloud
 /**
  * Store an item in the storage service.
  * 
  * @param  string $destinationPath
  * @param  mixed $data
  * @param  array $options
  * @return void
  */
 public function storeItem($destinationPath, $data, $options = null)
 {
     $this->rackspace->storeObject($this->container, $destinationPath, $data, $options);
     if (!$this->rackspace->isSuccessful()) {
         throw new Exception\RuntimeException('Error on store: ' . $this->rackspace->getErrorMsg());
     }
 }
コード例 #2
0
ファイル: OfflineTest.php プロジェクト: noose/zf2
 public function testStoreObject()
 {
     $content= 'This is a test!';
     $result= $this->rackspace->storeObject(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME, 
                                            TESTS_ZEND_SERVICE_RACKSPACE_OBJECT_NAME,
                                            $content,
                                            $this->metadata);
     $this->assertTrue($result);
 }
コード例 #3
0
ファイル: Container.php プロジェクト: navtis/xerxes-pazpar2
 /**
  * Add an object in the container
  *
  * @param string $name
  * @param string $file the content of the object
  * @param array $metadata
  * @return boolen
  */
 public function addObject($name, $file, $metadata = array())
 {
     return $this->service->storeObject($this->getName(), $name, $file, $metadata);
 }