Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function save()
 {
     $contents = $this->getForStorage();
     if ($this->adapter->has($this->file)) {
         $this->adapter->update($this->file, $contents);
     } else {
         $this->adapter->write($this->file, $contents);
     }
 }
Пример #2
0
 /**
  * Get a file's metadata
  *
  * @param  string                $path path to file
  * @throws FileNotFoundException
  * @return array|false           file metadata or FALSE when fails
  *                               to fetch it from existing file
  */
 public function getMetadata($path)
 {
     $path = Util::normalizePath($path);
     $this->assertPresent($path);
     if ($metadata = $this->cache->getMetadata($path)) {
         return $metadata;
     }
     if (!($metadata = $this->adapter->getMetadata($path))) {
         return false;
     }
     return $this->cache->updateObject($path, $metadata, true);
 }