Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear cache via console (cache/flush-all) #2099

Closed
timkelty opened this issue Nov 9, 2017 · 1 comment
Closed

Clear cache via console (cache/flush-all) #2099

timkelty opened this issue Nov 9, 2017 · 1 comment
Labels

Comments

@timkelty
Copy link
Contributor

timkelty commented Nov 9, 2017

Yii already has console commands to flush the cache:

This is Yii version 2.0.13.

The following commands are available:
- cache                       Allows you to flush cache.
    cache/flush               Flushes given cache components.
    cache/flush-all           Flushes all caches registered in the system.
    cache/flush-schema        Clears DB schema cache for a given connection component.
    cache/index (default)     Lists the caches that can be flushed.

Would be great if we could use the craft console to flush.

Currently, this throws an error, as it seems the @web and @webroot path aliases aren't available:

❯ ./bin/craft cache/flush-all
Exception 'yii\base\InvalidParamException' with message 'Invalid path alias: @webroot/cpresources'

in /Users/timkelty/Sites/coalesse-craft3/vendor/composer/yiisoft/yii2/BaseYii.php:154

Stack trace:
#0 /Users/timkelty/Sites/coalesse-craft3/vendor/composer/yiisoft/yii2/web/AssetManager.php(211): yii\BaseYii::getAlias('@w

Similar/related issue: yiisoft/yii2#12631

@timkelty
Copy link
Contributor Author

Thanks! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants