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
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
__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.