You are here

public function LocalStream::dir_rewinddir in Drupal 9

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

Rewind directory handle.

This method is called in response to rewinddir(). Should reset the output generated by PhpStreamWrapperInterface::dir_readdir. The next call to PhpStreamWrapperInterface::dir_readdir should return the first entry in the location returned by PhpStreamWrapperInterface::dir_opendir.

Return value

bool Returns TRUE on success or FALSE on failure.

Overrides PhpStreamWrapperInterface::dir_rewinddir

See also

rewinddir()

PhpStreamWrapperInterface::dir_readdir()

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

File

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

Class

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

Namespace

Drupal\Core\StreamWrapper

Code

public function dir_rewinddir() {
  rewinddir($this->handle);

  // We do not really have a way to signal a failure as rewinddir() does not
  // have a return value and there is no way to read a directory handler
  // without advancing to the next file.
  return TRUE;
}