You are here

public function LocalStream::stream_flush in Drupal 9

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

Flushes the output.

This method is called in response to fflush() and when the stream is being closed while any un-flushed data has been written to it before. If you have cached data in your stream but not yet stored it into the underlying storage, you should do so now.

Note, if not implemented, FALSE is assumed as the return value.

Return value

bool Should return TRUE if the cached data was successfully stored (or if there was no data to store), or FALSE if the data could not be stored.

Overrides PhpStreamWrapperInterface::stream_flush

See also

fflush()

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

1 method overrides LocalStream::stream_flush()
LocalReadOnlyStream::stream_flush in core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php
Support for fflush().

File

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

Class

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

Namespace

Drupal\Core\StreamWrapper

Code

public function stream_flush() {
  return fflush($this->handle);
}