PHP Класс Prado\Caching\TDirectoryCacheDependency

TDirectoryCacheDependency performs dependency checking based on the modification time of the files contained in the specified directory. The directory being checked is specified via {@link setDirectory Directory}. By default, all files under the specified directory and subdirectories will be checked. If the last modification time of any of them is changed or if different number of files are contained in a directory, the dependency is reported as changed. By specifying {@link setRecursiveCheck RecursiveCheck} and {@link setRecursiveLevel RecursiveLevel}, one can limit the checking to a certain depth of the subdirectories.
С версии: 3.1.0
Автор: Qiang Xue ([email protected])
Наследование: extends TCacheDependency
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( $directory ) Constructor.
getDirectory ( ) : string
getHasChanged ( ) : boolean Performs the actual dependency checking.
getRecursiveCheck ( ) : boolean
getRecursiveLevel ( ) : integer
setDirectory ( $directory )
setRecursiveCheck ( $value )
setRecursiveLevel ( $value ) Sets a value indicating the depth of the subdirectories to be checked.

Защищенные методы

Метод Описание
generateTimestamps ( $directory, $level ) : array Determines the last modification time for files under the directory.
validateDirectory ( $directory ) : boolean Checks to see if the specified subdirectory should be checked for dependency.
validateFile ( $fileName ) : boolean Checks to see if the file should be checked for dependency.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( $directory )

generateTimestamps() защищенный Метод

This method may go recursively into subdirectories if {@link setRecursiveCheck RecursiveCheck} is set true.
protected generateTimestamps ( $directory, $level ) : array
Результат array list of file modification time indexed by the file path

getDirectory() публичный Метод

public getDirectory ( ) : string
Результат string the directory to be checked

getHasChanged() публичный Метод

This method returns true if the directory is changed.
public getHasChanged ( ) : boolean
Результат boolean whether the dependency is changed or not.

getRecursiveCheck() публичный Метод

public getRecursiveCheck ( ) : boolean
Результат boolean whether the subdirectories of the directory will also be checked. It defaults to true.

getRecursiveLevel() публичный Метод

public getRecursiveLevel ( ) : integer
Результат integer the depth of the subdirectories to be checked. It defaults to -1, meaning unlimited depth.

setDirectory() публичный Метод

public setDirectory ( $directory )

setRecursiveCheck() публичный Метод

public setRecursiveCheck ( $value )

setRecursiveLevel() публичный Метод

This is meaningful only when {@link getRecursiveCheck RecursiveCheck} is true.
public setRecursiveLevel ( $value )

validateDirectory() защищенный Метод

This method is invoked when dependency of the whole directory is being checked. By default, it always returns true, meaning the subdirectory should be checked. You may override this method to check only certain subdirectories.
protected validateDirectory ( $directory ) : boolean
Результат boolean whether this subdirectory should be checked.

validateFile() защищенный Метод

This method is invoked when dependency of the whole directory is being checked. By default, it always returns true, meaning the file should be checked. You may override this method to check only certain files.
protected validateFile ( $fileName ) : boolean
Результат boolean whether this file should be checked.