public function stream_open($path, $mode, $options, &$openedPath) { $mode = trim($mode, 'tb'); switch ($mode) { case 'r': case 'r+': $this->read = 0; return true; default: return false; } }