function LocalStream::stream_open
Same name in other branches
- 9 core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::stream_open()
- 10 core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::stream_open()
- 11.x core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::stream_open()
Support for fopen(), file_get_contents(), file_put_contents() etc.
Parameters
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.
Return value
bool Returns TRUE if file was opened successfully.
Overrides PhpStreamWrapperInterface::stream_open
See also
http://php.net/manual/streamwrapper.stream-open.php
1 call to LocalStream::stream_open()
- LocalReadOnlyStream::stream_open in core/
lib/ Drupal/ Core/ StreamWrapper/ LocalReadOnlyStream.php - Support for fopen(), file_get_contents(), file_put_contents() etc.
1 method overrides LocalStream::stream_open()
- LocalReadOnlyStream::stream_open in core/
lib/ Drupal/ Core/ StreamWrapper/ LocalReadOnlyStream.php - Support for fopen(), file_get_contents(), file_put_contents() etc.
File
-
core/
lib/ Drupal/ Core/ StreamWrapper/ LocalStream.php, line 163
Class
- LocalStream
- Defines a Drupal stream wrapper base class for local files.
Namespace
Drupal\Core\StreamWrapperCode
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.