MediaWiki master
FSFileBackendList Class Reference

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

Inherits Iterator.

Inherited by FSFileBackendDirList, and FSFileBackendFileList.

Collaboration diagram for 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 29 of file FSFileBackendList.php.

Constructor & Destructor Documentation

◆ __construct()

FSFileBackendList::__construct ( $dir,
array $params )
Parameters
string$dirFile system directory
array$params

Definition at line 48 of file FSFileBackendList.php.

References $params, $path, and initIterator().

Member Function Documentation

◆ current()

FSFileBackendList::current ( )
See also
Iterator::current()
Returns
string|false

Definition at line 101 of file FSFileBackendList.php.

◆ filterViaNext()

FSFileBackendList::filterViaNext ( )
protected

Filter out items by advancing to the next ones.

Reimplemented in FSFileBackendDirList, and FSFileBackendFileList.

Definition at line 155 of file FSFileBackendList.php.

◆ getLastError()

FSFileBackendList::getLastError ( )
Returns
string|null The last caught exception message

Definition at line 148 of file FSFileBackendList.php.

◆ getRelPath()

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 165 of file FSFileBackendList.php.

References $path.

◆ initIterator()

FSFileBackendList::initIterator ( $dir)
protected

Return an appropriate iterator object to wrap.

Parameters
string$dirFile system directory
Returns
Iterator
Exceptions
UnexpectedValueException

Definition at line 71 of file FSFileBackendList.php.

Referenced by __construct().

◆ key()

FSFileBackendList::key ( )
See also
Iterator::key()
Returns
int

Definition at line 92 of file FSFileBackendList.php.

◆ next()

FSFileBackendList::next ( )
See also
Iterator::next()
Exceptions
FileBackendError

Definition at line 109 of file FSFileBackendList.php.

◆ rewind()

FSFileBackendList::rewind ( )
See also
Iterator::rewind()
Exceptions
FileBackendError

Definition at line 125 of file FSFileBackendList.php.

◆ valid()

FSFileBackendList::valid ( )
See also
Iterator::valid()
Returns
bool

Definition at line 141 of file FSFileBackendList.php.

Member Data Documentation

◆ $iter

Iterator null FSFileBackendList::$iter
protected

Definition at line 31 of file FSFileBackendList.php.

◆ $lastError

string FSFileBackendList::$lastError
protected

Definition at line 33 of file FSFileBackendList.php.

◆ $params

array FSFileBackendList::$params = []
protected

Definition at line 42 of file FSFileBackendList.php.

Referenced by __construct().

◆ $pos

int FSFileBackendList::$pos = 0
protected

Definition at line 39 of file FSFileBackendList.php.

◆ $suffixStart

int FSFileBackendList::$suffixStart
protected

Definition at line 36 of file FSFileBackendList.php.


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