VCR\Util\StreamProcessor::stream_metadata PHP Method

stream_metadata() public method

Change stream options.
public stream_metadata ( string $path, integer $option, mixed $value ) : boolean
$path string The file path or URL to set metadata.
$option integer One of the stream options.
$value mixed Value depending on the option.
return boolean Returns TRUE on success or FALSE on failure.
    public function stream_metadata($path, $option, $value)
    {
        $this->restore();
        $result = null;
        switch ($option) {
            case STREAM_META_TOUCH:
                if (empty($value)) {
                    $result = touch($path);
                } else {
                    $result = touch($path, $value[0], $value[1]);
                }
                break;
            case STREAM_META_OWNER_NAME:
            case STREAM_META_OWNER:
                $result = chown($path, $value);
                break;
            case STREAM_META_GROUP_NAME:
            case STREAM_META_GROUP:
                $result = chgrp($path, $value);
                break;
            case STREAM_META_ACCESS:
                $result = chmod($path, $value);
                break;
        }
        $this->intercept();
        return $result;
    }