PHP Class 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.
Show file
Open project: pradosoft/prado
Class Usage Examples
Public Methods
Protected Methods
Method |
Description |
|
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. |
|
Method Details
__construct()
public method
generateTimestamps()
protected method
This method may go recursively into subdirectories if
{@link setRecursiveCheck RecursiveCheck} is set true.
getDirectory()
public method
getHasChanged()
public method
This method returns true if the directory is changed.
getRecursiveCheck()
public method
getRecursiveLevel()
public method
setDirectory()
public method
setRecursiveCheck()
public method
setRecursiveLevel()
public method
This is meaningful only when {@link getRecursiveCheck RecursiveCheck}
is true.
validateDirectory()
protected method
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.
validateFile()
protected method
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.