@param $path

@return mixed
@throws Exception
347851
public function parse($path)
    {
        try {
            $data = YamlParser::parse(file_get_contents($path));
        } catch (Exception $exception) {
            throw new Exception('Error parsing YAML file');
        }
        return $data;
    }
538981
public function parse($path)
    {
        // Require the file, if it throws an exception, rethrow it
        try {
            $temp = require $path;
        } catch (Exception $exception) {
            throw new ParseException(
                array(
                    'message'   => 'PHP file threw an exception',
                    'exception' => $exception,
                )
            );
        }

        // If we have a callable, run it and expect an array back
        if (is_callable($temp)) {
            $temp = call_user_func($temp);
        }

        // Check for array, if its anything else, throw an exception
        if (!is_array($temp)) {
            throw new UnsupportedFormatException('PHP file does not return an array');
        }

        return $temp;
    }
1253676
public function load($path)
    {
        $key = $this->getCacheKey($path);

        if (isset($this->data[$key])) {
            return $this->data[$key];
        }

        return null;
    }
1140792
public function get(string $path = null)
    {
        if (null === $path)
            return $this->data;
        $keys = explode('.', $path);
        $value = $this->data;
        foreach ($keys as $key) {
            if (!is_array($value) || !array_key_exists($key, $value))
                throw new \Exception("Unable to find a configuration value with path '{$path}'");
            $value = $value[$key];
        }
        return $value;
    }
39892
public function getNodes($path)
    {
        $domXPath = new \DOMXpath($this->domDocument);
        // TODO: Swap the lines below for version 5.1.
        //			$nodes = $domXPath->evaluate($path);
        $nodes = $domXPath->query($path);
        if ($nodes) {
            return ($nodes->length > 0) ? $nodes : null;
        } else {
            throw new Exception('Bad XPath expression: ' . $path);
        }
    }
793742
public function rmdir( $path )
	{
		try {
			$this->fs->deleteDirectory( $path );
		} catch( \Exception $e ) {
			throw new Exception( $e->getMessage(), 0, $e );
		}
	}
1191293
public function fromPath($path)
    {
        $mimetype = null;

        if (static::isSupported())
        {
            if (!is_file($path)) {
                throw new \RuntimeException('File not found at '.$path);
            }

            if (!is_readable($path)) {
                throw new \RuntimeException('File not readable at '.$path);
            }

            if ($finfo = new \finfo(FILEINFO_MIME_TYPE, $this->getConfig()->magic_file)) {
                $mimetype = $finfo->file($path);
            }
        }

        return $mimetype;
    }
907515
public static function getViewContent($path) {
        if ($path === false) {
            throw new \Exception('The view file is not specified. Probably the correct path to the file was not found. Make sure that all paths are specified correctly, the files exists and is available.');
        }

        ob_start();

        require($path);

        $result = ob_get_contents();

        ob_end_clean();

        return $result;
    }
1134461
public function getMetadata($path)
    {
        $command = $this->s3Client->getCommand(
            'headObject',
            [
                'Bucket' => $this->bucket,
                'Key'    => $this->applyPathPrefix($path),
            ] + $this->options
        );

        /* @var Result $result */
        try {
            $result = $this->s3Client->execute($command);
        } catch (S3Exception $exception) {
            $response = $exception->getResponse();

            if ($response !== null && $response->getStatusCode() === 404) {
                return false;
            }

            throw $exception;
        }

        return $this->normalizeResponse($result->toArray(), $path);
    }
1205293
protected function request($path)
    {
        try {
            return @json_decode($this->guzzle->get($path)->getBody(), true);
        } catch (\Exception $e) {
            return false;
        }
    }
287175
public function load($path)
    {
        if (!is_readable($path)) {
            throw new \InvalidArgumentException('Invalid laravel routes path found: ' . $path);
        }

        // localising the object so the $path file can reference $router;
        $router = $this->router;

        // The included file must return the laravel router
        include $path;

        if (!($router instanceof LaravelRouter)) {
            throw new \Exception('Invalid return value from '
                . pathinfo($path, PATHINFO_FILENAME)
                . ' expected instance of LaravelRouter'
            );
        }

        return $router;
    }
96885
public function file($path)
    {
        if (!isset($this->_baseDir)) {
            throw new App\Exception('Base directory not set');
        }
        return $this->_baseDir->file($path);
    }
1253132
public function get($path = null) {
		// return full tree
		if (is_null($path)) return $this->_tree;

		if (!isset($this->_nodes[$path])) {
			throw new \Exception(__METHOD__.': path "'.$path.'" does not exist.');
			return;
		}
		return $this->_nodes[$path];
	}
917569
public static function decodeFromFile($path)
    {
        if (!is_file($path)) {
            throw new FileException("File does not exist: {$path}");
        }

        $string = file_get_contents($path);

        if ($string === false) {
            throw new FileException("Failed to read the file: {$path}");
        }

        return static::decode($string);
    }
747647
public function get(string $path) : string {

		if(! file_exists($path) )
			throw new FileNotFoundException($path, 200);

		return file_get_contents($path);
	}
847566
protected function request($path)
  {
    $response = $this->client->get($this->url . $path);

    if ( $response->getStatusCode() != 200 )
      throw new \Exception('Bierdopje.com not available');

    $response = $this->xmlToObj($response->getBody());

    return $response;
  }
298983
public function normalizePath($path)
	{
		$path = rtrim($path, '/\\').DIRECTORY_SEPARATOR;
		$path = realpath($path).DIRECTORY_SEPARATOR;

		if ($this->root and strpos($path, $this->root) !== 0)
		{
			throw new \Exception('Cannot access path outside: '.$this->root.'. Trying to access: '.$path);
		}

		return $path;
	}