AppPathDependency
- Type
- Class
- Namespace
- craft\cache
- Inherits
- craft\cache\AppPathDependency » yii\caching\Dependency (opens new window) » yii\base\BaseObject (opens new window)
- Implements
- yii\base\Configurable (opens new window)
- Since
- 3.0.0
AppPathDependency is used to determine if Craft’s base path has changed.
View source (opens new window)
# Public Properties
Property | Description |
---|---|
appPath | string (opens new window) – Craft’s base path |
data (opens new window) | mixed – The dependency data that is saved in cache and later is compared with the latest dependency data. |
reusable (opens new window) | boolean (opens new window) – Whether this dependency is reusable or not. |
# appPath
- Type
- string (opens new window)
- Default value
null
Craft’s base path
View source (opens new window)
# Public Methods
Method | Description |
---|---|
__call() (opens new window) | Calls the named method which is not a class method. |
__construct() (opens new window) | Constructor. |
__get() (opens new window) | Returns the value of an object property. |
__isset() (opens new window) | Checks if a property is set, i.e. defined and not null. |
__set() (opens new window) | Sets value of an object property. |
__unset() (opens new window) | Sets an object property to null. |
canGetProperty() (opens new window) | Returns a value indicating whether a property can be read. |
canSetProperty() (opens new window) | Returns a value indicating whether a property can be set. |
className() (opens new window) | Returns the fully qualified name of this class. |
evaluateDependency() (opens new window) | Evaluates the dependency by generating and saving the data related with dependency. |
getHasChanged() (opens new window) | Returns a value indicating whether the dependency has changed. |
hasMethod() (opens new window) | Returns a value indicating whether a method is defined. |
hasProperty() (opens new window) | Returns a value indicating whether a property is defined. |
init() | Initializes the object. |
isChanged() (opens new window) | Checks whether the dependency is changed. |
resetReusableData() (opens new window) | Resets all cached data for reusable dependencies. |
# init()
Initializes the object.
This method is invoked at the end of the constructor after the object is initialized with the given configuration.
View source (opens new window)
# Protected Methods
Method | Description |
---|---|
generateDependencyData() | Generates the data needed to determine if dependency is changed. |
generateReusableHash() (opens new window) | Generates a unique hash that can be used for retrieving reusable dependency data. |
# generateDependencyData()
Generates the data needed to determine if dependency is changed.
Derived classes should override this method to generate the actual dependency data.
View source (opens new window)
Arguments
$cache
(yii\caching\CacheInterface (opens new window)) – The cache component that is currently evaluating this dependency
Returns
mixed
– The data needed to determine if dependency has been changed.