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 \Prado\Caching\setDirectory.
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 \Prado\Caching\setRecursiveCheck and \Prado\Caching\setRecursiveLevel, one can limit the checking to a certain depth of the subdirectories.
Class hierarchy
- \Prado\Caching\TDirectoryCacheDependency
- \Prado\Caching\TCacheDependency implements ICacheDependency
- \Prado\TComponent
Since: 3.1.0
public
|
|
public
|
|
public
|
getHasChanged() : bool
Performs the actual dependency checking.
This method returns true if the directory is changed. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
setRecursiveLevel(int $value) : mixed
Sets a value indicating the depth of the subdirectories to be checked.
This is meaningful only when \Prado\Caching\getRecursiveCheck is true. |
protected
|
generateTimestamps(string $directory[, int $level = 0 ]) : array<string|int, mixed>
Determines the last modification time for files under the directory.
This method may go recursively into subdirectories if \Prado\Caching\setRecursiveCheck is set true. |
protected
|
validateDirectory(string $directory) : bool
Checks to see if the specified subdirectory should be checked for dependency.
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
|
validateFile(string $fileName) : bool
Checks to see if the file should be checked for dependency.
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. |
\Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |