VCR\Util\StreamProcessor::stream_open PHP Method

stream_open() public method

Opens a stream and attaches registered filters.
public stream_open ( string $path, string $mode, integer $options, string &$openedPath ) : boolean
$path string Specifies the URL that was passed to the original function.
$mode string The mode used to open the file, as detailed for fopen().
$options integer Holds additional flags set by the streams API. It can hold one or more of the following values OR'd together.
$openedPath string If the path is opened successfully, and STREAM_USE_PATH is set in options, opened_path should be set to the full path of the file/resource that was actually opened.
return boolean Returns TRUE on success or FALSE on failure.
    public function stream_open($path, $mode, $options, &$openedPath)
    {
        $this->restore();
        if (isset($this->context)) {
            $this->resource = fopen($path, $mode, $options & STREAM_USE_PATH, $this->context);
        } else {
            $this->resource = fopen($path, $mode, $options & STREAM_USE_PATH);
        }
        if ($options & self::STREAM_OPEN_FOR_INCLUDE && $this->shouldProcess($path)) {
            $this->appendFiltersToStream($this->resource);
        }
        $this->intercept();
        return $this->resource !== false;
    }