Ejemplo n.º 1
0
 /**
  * Update a file with the contents of a stream
  *
  * @param   string    $path
  * @param   resource  $resource
  * @return  bool      success boolean
  * @throws  InvalidArgumentException
  */
 public function updateStream($path, $resource)
 {
     $path = Util::normalizePath($path);
     $this->assertPresent($path);
     if (!is_resource($resource)) {
         throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');
     }
     if (!($object = $this->adapter->updateStream($path, $resource))) {
         return false;
     }
     $this->cache->updateObject($path, $object, true);
     $this->cache->ensureParentDirectories($path);
     return true;
 }