You are here

public function SessionStreamWrapper::stream_eof in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php \Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper::stream_eof()

Tests for end-of-file on a file pointer.

This method is called in response to feof().

Warning, when reading the whole file (for example, with file_get_contents()), PHP will call PhpStreamWrapperInterface::stream_read() followed by PhpStreamWrapperInterface::stream_eof() in a loop but as long as PhpStreamWrapperInterface::stream_read() returns a non-empty string, the return value of PhpStreamWrapperInterface::stream_eof() is ignored.

Return value

bool Should return TRUE if the read/write position is at the end of the stream and if no more data is available to be read, or FALSE otherwise.

Overrides PhpStreamWrapperInterface::stream_eof

See also

feof()

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

File

modules/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php, line 497

Class

SessionStreamWrapper
Example stream wrapper class to handle session:// streams.

Namespace

Drupal\stream_wrapper_example\StreamWrapper

Code

public function stream_eof() {

  // @codingStandardsIgnoreEnd
  return FALSE;
}