You are here

public function S3fsStreamWrapper::stream_open in S3 File System 7.3

Same name and namespace in other branches
  1. 7 S3fsStreamWrapper.inc \S3fsStreamWrapper::stream_open()
  2. 7.2 S3fsStreamWrapper.inc \S3fsStreamWrapper::stream_open()

Support for fopen(), file_get_contents(), file_put_contents() etc.

Parameters

string $uri: The URI of the file to open.

string $mode: The file mode. Only 'r', 'w', 'a', and 'x' are supported.

int $options: A bit mask of STREAM_USE_PATH and STREAM_REPORT_ERRORS.

string $opened_path: An OUT parameter populated with the path which was opened. This wrapper does not support this parameter.

Return value

bool TRUE if file was opened successfully. Otherwise, FALSE.

Overrides StreamWrapperInterface::stream_open

See also

http://php.net/manual/en/streamwrapper.stream-open.php

File

./S3fsStreamWrapper.inc, line 628
Drupal stream wrapper implementation for S3 File System.

Class

S3fsStreamWrapper
The stream wrapper class.

Code

public function stream_open($uri, $mode, $options, &$opened_path) {
  $this
    ->setUri($uri);
  $converted = $this
    ->convertUriToKeyedPath($uri);
  return parent::stream_open($converted, $mode, $options, $opened_path);
}