示例#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 Exception\RuntimeException('Error on fetch: ' . $this->rackspace->getErrorMsg());
     }
     if (!empty($item)) {
         return $item->getContent();
     } else {
         return false;
     }
 }