public LocalStream::stream_open($uri, $mode, $options, &$opened_path)
Support for fopen(), file_get_contents(), file_put_contents() etc.
string $uri: A string containing the URI to the file to open.
int $mode: The file mode ("r", "wb" etc.).
int $options: A bit mask of STREAM_USE_PATH and STREAM_REPORT_ERRORS.
string $opened_path: A string containing the path actually opened.
bool Returns TRUE if file was opened successfully.
Overrides PhpStreamWrapperInterface::stream_open
http://php.net/manual/streamwrapper.stream-open.php
public function stream_open($uri, $mode, $options, &$opened_path) { $this->uri = $uri; $path = $this->getLocalPath(); $this->handle = ($options & STREAM_REPORT_ERRORS) ? fopen($path, $mode) : @fopen($path, $mode); if ((bool) $this->handle && $options & STREAM_USE_PATH) { $opened_path = $path; } return (bool) $this->handle; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StreamWrapper!LocalStream.php/function/LocalStream::stream_open/8.1.x