1 file_example_session_streams.inc public FileExampleSessionStreamWrapper::stream_seek($offset, $whence)

Support for fseek().

Parameters

int $offset: The byte offset to got to.

int $whence: SEEK_SET, SEEK_CUR, or SEEK_END.

Return value

bool: TRUE on success.

Overrides StreamWrapperInterface::stream_seek

See also

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

File

modules/examples/file_example/file_example_session_streams.inc, line 377
Provides a demonstration session:// stream-wrapper.

Class

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

Code

public function stream_seek($offset, $whence) {
  if (backdrop_strlen($this->sessionContent) >= $offset) {
    $this->streamPointer = $offset;
    return TRUE;
  }

  return FALSE;
}