PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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
Extended by TCacheDependency implements ICacheDependency
Extended by TDirectoryCacheDependency
Package: System\Caching
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
Methods summary
public
# __construct( string $directory )

Constructor.

Constructor.

Parameters

$directory
string
the directory to be checked

Overrides

TComponent::__construct()
public string
# getDirectory( )

Returns

string
the directory to be checked
public
# setDirectory( string $directory )

Parameters

$directory
string
the directory to be checked

Throws

TInvalidDataValueException
if the directory does not exist
public boolean
# getRecursiveCheck( )

Returns

boolean
whether the subdirectories of the directory will also be checked. It defaults to true.
public
# setRecursiveCheck( boolean $value )

Parameters

$value
boolean
whether the subdirectories of the directory will also be checked.
public integer
# getRecursiveLevel( )

Returns

integer
the depth of the subdirectories to be checked. It defaults to -1, meaning unlimited depth.
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.

Sets a value indicating the depth of the subdirectories to be checked. This is meaningful only when getRecursiveCheck RecursiveCheck is true.

Parameters

$value
integer
the depth of the subdirectories to be checked. If the value is less than 0, it means unlimited depth. If the value is 0, it means checking the files directly under the specified directory.
public boolean
# getHasChanged( )

Performs the actual dependency checking. This method returns true if the directory is changed.

Performs the actual dependency checking. This method returns true if the directory is changed.

Returns

boolean
whether the dependency is changed or not.
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.

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.

Parameters

$fileName
string
the name of the file that may be checked for dependency.

Returns

boolean
whether this file should be checked.
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.

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.

Parameters

$directory
string
the name of the subdirectory that may be checked for dependency.

Returns

boolean
whether this subdirectory should be checked.
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.

Determines the last modification time for files under the directory. This method may go recursively into subdirectories if setRecursiveCheck RecursiveCheck is set true.

Parameters

$directory
string
the directory name
$level
integer
level of the recursion

Returns

array
list of file modification time indexed by the file path
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO