Autarky\Config\Loaders\YamlFileLoader::load PHP Метод

load() публичный Метод

public load ( $path )
    public function load($path)
    {
        $yaml = $this->filesys->read($path);
        try {
            return $this->parser->parse($yaml);
        } catch (ParseException $e) {
            throw new LoadException($e->getMessage(), $e->getCode(), $e);
        }
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function load($path)
 {
     $cachePath = $this->cacheDir . '/' . md5($path);
     if ($this->shouldLoadCache($path, $cachePath)) {
         return require $cachePath;
     }
     $data = parent::load($path);
     $this->filesys->write($cachePath, '<?php return ' . var_export($data, true) . ";\n");
     return $data;
 }
YamlFileLoader