Example #1
0
 /**
  * Read a file
  *
  * @param  string                $path path to file
  * @throws FileNotFoundException
  * @return string|false          file contents or FALSE when fails
  *                               to read existing file
  */
 public function read($path)
 {
     $path = Util::normalizePath($path);
     $this->assertPresent($path);
     if ($contents = $this->cache->read($path)) {
         return $contents;
     }
     if (!($object = $this->adapter->read($path))) {
         return false;
     }
     $this->cache->updateObject($path, $object, true);
     return $object['contents'];
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function load()
 {
     if (($file = $this->adapter->read($this->file)) !== null) {
         $this->setFromStorage($file['contents']);
     }
 }