Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CCacheDependency
  • CChainedCacheDependency
  • CDbCacheDependency
  • CDirectoryCacheDependency
  • CExpressionDependency
  • CFileCacheDependency
  • CGlobalStateCacheDependency
  • Overview
  • Package
  • Class
  • Tree

Class CDirectoryCacheDependency

CDirectoryCacheDependency represents a dependency based on change of a directory.

CDirectoryCacheDependency performs dependency checking based on the modification time of the files contained in the specified directory. The directory being checked is specified via CDirectoryCacheDependency::$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 CDirectoryCacheDependency::$recursiveLevel, one can limit the checking to a certain depth of the directory.

Note, dependency checking for a directory is expensive because it involves accessing modification time of multiple files under the directory.

CComponent
Extended by CCacheDependency implements ICacheDependency
Extended by CDirectoryCacheDependency
Package: system\caching\dependencies
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/caching/dependencies/CDirectoryCacheDependency.php
Methods summary
public
# __construct( string $directory = null )

Constructor.

Constructor.

Parameters

$directory
string
$directory the directory to be checked
protected mixed
# generateDependentData( )

Generates the data needed to determine if dependency has been changed. This method returns the modification timestamps for files under the directory.

Generates the data needed to determine if dependency has been changed. This method returns the modification timestamps for files under the directory.

Returns

mixed
the data needed to determine if dependency has been changed.

Throws

CException
if CDirectoryCacheDependency::$directory is empty

Overrides

CCacheDependency::generateDependentData()
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 CDirectoryCacheDependency::$recursiveLevel is not 0.

Determines the last modification time for files under the directory. This method may go recursively into subdirectories if CDirectoryCacheDependency::$recursiveLevel is not 0.

Parameters

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

Returns

array
list of file modification time indexed by the file path

Throws

CException
if given directory is not valid
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
$fileName 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
$directory the name of the subdirectory that may be checked for dependency.

Returns

boolean
whether this subdirectory should be checked.
Methods inherited from CCacheDependency
evaluateDependency(), getDependentData(), getHasChanged(), resetReusableData()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public string $directory
#

the directory whose change is used to determine if the dependency has been changed. If any of the files under the directory is changed, the dependency is considered as changed.

the directory whose change is used to determine if the dependency has been changed. If any of the files under the directory is changed, the dependency is considered as changed.

public integer $recursiveLevel -1
#

the depth of the subdirectories to be recursively 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.

the depth of the subdirectories to be recursively 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 string $namePattern
#

the regular expression matching valid file/directory names. Only the matching files or directories will be checked for changes. Defaults to null, meaning all files/directories will qualify.

the regular expression matching valid file/directory names. Only the matching files or directories will be checked for changes. Defaults to null, meaning all files/directories will qualify.

Properties inherited from CCacheDependency
$reuseDependentData
Magic properties inherited from CCacheDependency
$dependentData, $hasChanged
API documentation generated by ApiGen 2.8.0