TestFileSystemStream::stream_open PHP Method

stream_open() public method

Opens a file.
public stream_open ( string $path, string $mode, integer $options, string &$openedPath ) : boolean
$path string File path
$mode string Open mode
$options integer Additional options
$openedPath string Opened file path
return boolean
    public function stream_open($path, $mode, $options, &$openedPath)
    {
        $mode = trim($mode, 'tb');
        switch ($mode) {
            case 'r':
            case 'r+':
            case 'w':
            case 'w+':
                $this->path = $path;
                if (!isset(self::$dir[$this->path])) {
                    self::$dir[$this->path] = '';
                }
                $this->read = 0;
                return true;
            default:
                return false;
        }
    }