PHP Class yii2tech\admin\actions\FlushCache

The cache component to be flushed can be explicitly defined via [[cache]] or fetched automatically. Note that the action uses cache components defined in your current web application configuration file. If you wish to flush cache defined at other application, you should duplicate its definition in the configuration file, or setup it explicitly via [[cache]] property.
Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends Action
显示文件 Open project: yii2tech/admin

Public Properties

Property Type Description
$cache cache component(s), which should be flushed. If not set action will flush all cache components found in current application. Each cache component can be specified as application component name, instance of [[Cache]] or its configuration. For example: php [ 'cache', 'frontendCache' => [ 'class' => 'yii\caching\DbCache', 'cacheTable' => '{{%frontendCache}}', ], 'objectCache' => new \yii\caching\DbCache(['cacheTable' => '{{%objectCache}}']), ]
$flash flash message to be set on success.
$returnUrl the default return URL in case it was not set previously. This URL will be used only in case automatic determine of return URL failed.

Public Methods

Method Description
run ( string | array | null $name = null ) : mixed Flushes associated cache components.

Private Methods

Method Description
findCaches ( array $cachesNames = [] ) : array Returns array of caches in the system, keys are cache components names, values are class names.
flushCaches ( array $caches ) Flushes given caches list.
goBack ( ) : mixed Redirects the browser to the last visited page.
isCacheClass ( string $className ) : boolean Checks if given class is a Cache class.

Method Details

run() public method

Flushes associated cache components.
public run ( string | array | null $name = null ) : mixed
$name string | array | null name of the cache component(s), which should be flushed.
return mixed response.

Property Details

$cache public_oe property

cache component(s), which should be flushed. If not set action will flush all cache components found in current application. Each cache component can be specified as application component name, instance of [[Cache]] or its configuration. For example: php [ 'cache', 'frontendCache' => [ 'class' => 'yii\caching\DbCache', 'cacheTable' => '{{%frontendCache}}', ], 'objectCache' => new \yii\caching\DbCache(['cacheTable' => '{{%objectCache}}']), ]
public $cache

$flash public_oe property

flash message to be set on success.
See also: Action::setFlash() for details on how setup flash.
public $flash

$returnUrl public_oe property

the default return URL in case it was not set previously. This URL will be used only in case automatic determine of return URL failed.
public $returnUrl