You are here

public function S3fsStreamWrapper::stream_write in S3 File System 7.2

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

Support for fwrite(), file_put_contents() etc.

Parameters

string $data: The data to be written to the stream.

Return value

int The number of bytes actually written to the stream.

Overrides StreamWrapperInterface::stream_write

See also

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

File

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

Class

S3fsStreamWrapper
The stream wrapper class.

Code

public function stream_write($data) {
  $bytes = strlen($data);
  $this
    ->_debug("stream_write() called with {$bytes} bytes of data for {$this->uri}.");
  return $this->body
    ->write($data);
}