MediaWiki master
Wikimedia\FileBackend\FileIteration\FSFileBackendList Class Reference

Wrapper around RecursiveDirectoryIterator/DirectoryIterator that catches exception or does any custom behavior that we may want. More...

Inherits Iterator.

Inherited by Wikimedia\FileBackend\FileIteration\FSFileBackendDirList, and Wikimedia\FileBackend\FileIteration\FSFileBackendFileList.

Collaboration diagram for Wikimedia\FileBackend\FileIteration\FSFileBackendList:

Public Member Functions

 __construct ( $dir, array $params)
 
 current ()
 
 getLastError ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Protected Member Functions

 filterViaNext ()
 Filter out items by advancing to the next ones.
 
 getRelPath ( $dir)
 Return only the relative path and normalize slashes to FileBackend-style.
 
 initIterator ( $dir)
 Return an appropriate iterator object to wrap.
 

Protected Attributes

Iterator null $iter
 
string $lastError
 
array $params = []
 
int $pos = 0
 
int $suffixStart
 

Detailed Description

Wrapper around RecursiveDirectoryIterator/DirectoryIterator that catches exception or does any custom behavior that we may want.

Do not use this class from places outside FSFileBackend.

Definition at line 39 of file FSFileBackendList.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::__construct ( $dir,
array $params )

Member Function Documentation

◆ current()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::current ( )
See also
Iterator::current()
Returns
string|false

Definition at line 111 of file FSFileBackendList.php.

◆ filterViaNext()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::filterViaNext ( )
protected

Filter out items by advancing to the next ones.

Reimplemented in Wikimedia\FileBackend\FileIteration\FSFileBackendDirList, and Wikimedia\FileBackend\FileIteration\FSFileBackendFileList.

Definition at line 165 of file FSFileBackendList.php.

◆ getLastError()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::getLastError ( )
Returns
string|null The last caught exception message

Definition at line 158 of file FSFileBackendList.php.

◆ getRelPath()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::getRelPath ( $dir)
protected

Return only the relative path and normalize slashes to FileBackend-style.

Uses the "real path" since the suffix is based upon that.

Parameters
string$dir
Returns
string

Definition at line 175 of file FSFileBackendList.php.

References $path.

◆ initIterator()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::initIterator ( $dir)
protected

Return an appropriate iterator object to wrap.

Parameters
string$dirFile system directory
Returns
Iterator
Exceptions
UnexpectedValueException

Definition at line 81 of file FSFileBackendList.php.

Referenced by Wikimedia\FileBackend\FileIteration\FSFileBackendList\__construct().

◆ key()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::key ( )
See also
Iterator::key()
Returns
int

Definition at line 102 of file FSFileBackendList.php.

◆ next()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::next ( )
See also
Iterator::next()
Exceptions
FileBackendError

Definition at line 119 of file FSFileBackendList.php.

◆ rewind()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::rewind ( )
See also
Iterator::rewind()
Exceptions
FileBackendError

Definition at line 135 of file FSFileBackendList.php.

◆ valid()

Wikimedia\FileBackend\FileIteration\FSFileBackendList::valid ( )
See also
Iterator::valid()
Returns
bool

Definition at line 151 of file FSFileBackendList.php.

Member Data Documentation

◆ $iter

Iterator null Wikimedia\FileBackend\FileIteration\FSFileBackendList::$iter
protected

Definition at line 41 of file FSFileBackendList.php.

◆ $lastError

string Wikimedia\FileBackend\FileIteration\FSFileBackendList::$lastError
protected

Definition at line 43 of file FSFileBackendList.php.

◆ $params

array Wikimedia\FileBackend\FileIteration\FSFileBackendList::$params = []
protected

◆ $pos

int Wikimedia\FileBackend\FileIteration\FSFileBackendList::$pos = 0
protected

Definition at line 49 of file FSFileBackendList.php.

◆ $suffixStart

int Wikimedia\FileBackend\FileIteration\FSFileBackendList::$suffixStart
protected

Definition at line 46 of file FSFileBackendList.php.


The documentation for this class was generated from the following file: