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
 1: <?php
 2: /**
 3:  * CFileCacheDependency class file.
 4:  *
 5:  * @author Qiang Xue <qiang.xue@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: /**
12:  * CFileCacheDependency represents a dependency based on a file's last modification time.
13:  *
14:  * CFileCacheDependency performs dependency checking based on the
15:  * last modification time of the file specified via {@link fileName}.
16:  * The dependency is reported as unchanged if and only if the file's
17:  * last modification time remains unchanged.
18:  *
19:  * @author Qiang Xue <qiang.xue@gmail.com>
20:  * @package system.caching.dependencies
21:  * @since 1.0
22:  */
23: class CFileCacheDependency extends CCacheDependency
24: {
25:     /**
26:      * @var string the name of the file whose last modification time is used to
27:      * check if the dependency has been changed.
28:      */
29:     public $fileName;
30: 
31:     /**
32:      * Constructor.
33:      * @param string $fileName name of the file whose change is to be checked.
34:      */
35:     public function __construct($fileName=null)
36:     {
37:         $this->fileName=$fileName;
38:     }
39: 
40:     /**
41:      * Generates the data needed to determine if dependency has been changed.
42:      * This method returns the file's last modification time.
43:      * @throws CException if {@link fileName} is empty
44:      * @return mixed the data needed to determine if dependency has been changed.
45:      */
46:     protected function generateDependentData()
47:     {
48:         if($this->fileName!==null)
49:             return @filemtime($this->fileName);
50:         else
51:             throw new CException(Yii::t('yii','CFileCacheDependency.fileName cannot be empty.'));
52:     }
53: }
54: 
API documentation generated by ApiGen 2.8.0