function SessionStreamWrapper::stream_seek

Same name in other branches
  1. 3.x modules/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php \Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper::stream_seek()
  2. 4.0.x modules/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php \Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper::stream_seek()

File

stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php, line 516

Class

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

Namespace

Drupal\stream_wrapper_example\StreamWrapper

Code

public function stream_seek($offset, $whence = SEEK_SET) {
    // @codingStandardsIgnoreEnd
    if (strlen($this->sessionContent) >= $offset) {
        $this->streamPointer = $offset;
        return TRUE;
    }
    return FALSE;
}