You are here

public function SessionStreamWrapper::dir_readdir 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::dir_readdir()

Read entry from directory handle.

This method is called in response to readdir().

Return value

string|false Should return string representing the next filename, or FALSE if there is no next file. Note, the return value will be casted to string.

Overrides PhpStreamWrapperInterface::dir_readdir

See also

readdir()

http://php.net/manual/en/streamwrapper.dir-readdir.php

File

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

Class

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

Namespace

Drupal\stream_wrapper_example\StreamWrapper

Code

public function dir_readdir() {

  // @codingStandardsIgnoreEnd
  if ($this->directoryPointer < count($this->directoryKeys)) {
    $next = $this->directoryKeys[$this->directoryPointer];
    $this->directoryPointer++;
    return $next;
  }
  return FALSE;
}