Pipe\Manifest::read PHP Метод

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

public read ( )
    function read()
    {
        $data = @file_get_contents($this->manifest);
        if (false === $data) {
            throw new \UnexpectedValueException(sprintf('Manifest file "%s" not found', $this->manifest));
        }
        $m = json_decode($data);
        if (isset($m->files)) {
            foreach ($m->files as $file => $info) {
                $this->files->{$file} = $info;
            }
        }
        if (isset($m->assets)) {
            foreach ($m->assets as $logicalPath => $digestName) {
                $this->assets->{$logicalPath} = $digestName;
            }
        }
    }

Usage Example

Пример #1
0
 /**
  * @expectedException \UnexpectedValueException
  */
 function testReadThrowsExceptionWhenNotFound()
 {
     $env = new Environment();
     $manifest = new Manifest($env, __DIR__ . "/foo.json");
     $manifest->read();
 }