Skip to content

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.

View source

Public Properties ​

PropertyDescription
appPathstring – Craft’s base path
datamixed – The dependency data that is saved in cache and later is compared with the latest dependency data.
reusableboolean – Whether this dependency is reusable or not.

appPath ​

Type
string
Default value
null

Craft’s base path

View source

Public Methods ​

MethodDescription
__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.

View source

Protected Methods ​

MethodDescription
generateDependencyData()Generates the data needed to determine if dependency has been changed.
generateReusableHash()Generates a unique hash that can be used for retrieving reusable dependency data.

generateDependencyData() ​

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

View source

Arguments ​

  • $cache (yii\caching\Cache) – The cache component that is currently evaluating this dependency.

Returns ​

string – The data needed to determine if dependency has been changed.