Class TDirectoryCacheDependency
TDirectoryCacheDependency class.
TDirectoryCacheDependency performs dependency checking based on the modification time of the files contained in the specified directory. The directory being checked is specified via 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 setRecursiveCheck RecursiveCheck and setRecursiveLevel RecursiveLevel, one can limit the checking to a certain depth of the subdirectories.
- TComponent
-
TCacheDependency implements ICacheDependency
-
TDirectoryCacheDependency
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.1.0
Located at Caching/TCache.php
public
|
|
public
string
|
|
public
|
|
public
boolean
|
|
public
|
|
public
integer
|
|
public
|
#
setRecursiveLevel( integer $value )
Sets a value indicating the depth of the subdirectories to be checked. This is meaningful only when getRecursiveCheck RecursiveCheck is true. |
public
boolean
|
#
getHasChanged( )
Performs the actual dependency checking. This method returns true if the directory is changed. |
protected
boolean
|
#
validateFile( string $fileName )
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. |
protected
boolean
|
#
validateDirectory( string $directory )
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
array
|
#
generateTimestamps( string $directory, integer $level = 0 )
Determines the last modification time for files under the directory. This method may go recursively into subdirectories if setRecursiveCheck RecursiveCheck is set true. |
GLOBAL_RAISE_EVENT_LISTENER
|