AppPathDependency ​
- Type
- Class
- Namespace
- craft\cache
- Inherits
- craft\cache\AppPathDependency » yii\caching\Dependency » yii\base\BaseObject
- Implements
- yii\base\Configurable
- Since
- 3.0.0
AppPathDependency is used to determine if Craft’s base path has changed.
Public Properties ​
| Property | Description |
|---|---|
| appPath | string – Craft’s base path |
| data | mixed – The dependency data that is saved in cache and later is compared with the latest dependency data. |
| reusable | boolean – Whether this dependency is reusable or not. |
appPath ​
- Type
- string
- Default value
null
Craft’s base path
Public Methods ​
| Method | Description |
|---|---|
| __call() | Calls the named method which is not a class method. |
| __construct() | Constructor. |
| __get() | Returns the value of an object property. |
| __isset() | Checks if a property is set, i.e. defined and not null. |
| __set() | Sets value of an object property. |
| __unset() | Sets an object property to null. |
| canGetProperty() | Returns a value indicating whether a property can be read. |
| canSetProperty() | Returns a value indicating whether a property can be set. |
| className() | Returns the fully qualified name of this class. |
| evaluateDependency() | Evaluates the dependency by generating and saving the data related with dependency. |
| getHasChanged() | Returns a value indicating whether the dependency has changed. |
| hasMethod() | Returns a value indicating whether a method is defined. |
| hasProperty() | Returns a value indicating whether a property is defined. |
| init() | Initializes the object. |
| isChanged() | Checks whether the dependency is changed. |
| resetReusableData() | 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.
Protected Methods ​
| Method | Description |
|---|---|
| generateDependencyData() | Generates the data needed to determine if dependency is changed. |
| generateReusableHash() | 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.
Arguments ​
$cache(yii\caching\CacheInterface) – The cache component that is currently evaluating this dependency
Returns ​
mixed – The data needed to determine if dependency has been changed.