public function stream_open($uri,
$mode,
$options, &
$opened_path) { if (!
in_array($mode,
['r', 'rb', 'rt'
])) { if ($options & STREAM_REPORT_ERRORS
) { trigger_error('stream_open() write modes not supported for read-only stream wrappers', E_USER_WARNING
);
} return FALSE;
} $this->uri =
$uri;
$path =
$this->
getLocalPath();
$this->handle =
($options & STREAM_REPORT_ERRORS
) ?
fopen($path,
$mode) : @
fopen($path,
$mode);
if ($this->handle !== FALSE
&& ($options & STREAM_USE_PATH
)) { $opened_path =
$path;
} return (bool) $this->handle;
} /**
* Returns the canonical absolute path of the URI, if possible.
*
* @param string $uri
* (optional) The stream wrapper URI to be converted to a canonical
* absolute path. This may point to a directory or another type of file.
*
* @return string|bool
* If $uri is not set, returns the canonical absolute path of the URI
* previously set by the
* Drupal\Core\StreamWrapper\StreamWrapperInterface::setUri() function.
* If $uri is set and valid for this class, returns its canonical absolute
* path, as determined by the realpath() function. If $uri is set but not
* valid, returns FALSE.
*
* @throws \BadMethodCallException
* If the method is not implemented in the concrete driver class.
*
* @todo This method is called by ReadOnlyStream::stream_open on the abstract
* class, and therefore should be defined as well on the abstract class to
* prevent static analysis errors. In D11, consider changing it to an
* abstract method.
*/