You are here

public function LocalStream::stream_write in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::stream_write()

Write to stream.

This method is called in response to fwrite(). Remember to update the current position of the stream by number of bytes that were successfully written.

Parameters

string $data: Should be stored into the underlying stream. If there is not enough room in the underlying stream, store as much as possible.

Return value

int Should return the number of bytes that were successfully stored, or 0 if none could be stored.

Overrides PhpStreamWrapperInterface::stream_write

See also

fwrite()

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

1 method overrides LocalStream::stream_write()
LocalReadOnlyStream::stream_write in core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php
Support for fwrite(), file_put_contents() etc.

File

core/lib/Drupal/Core/StreamWrapper/LocalStream.php, line 188

Class

LocalStream
Defines a Drupal stream wrapper base class for local files.

Namespace

Drupal\Core\StreamWrapper

Code

public function stream_write($data) {
  return fwrite($this->handle, $data);
}