jadu / inspectable-stash-bundle
v2.0.1
2016-10-07 14:49 UTC
Requires
- php: >=5.5
- symfony/symfony: ~2
- tedivm/stash: ~0.12.0
- tedivm/stash-bundle: ^0.4.3
Requires (Dev)
README
Symfony 扩展,允许检查使用 Stash 缓存的数据。
使用方法
将此扩展添加到您的内核中,以安装缓存驱动程序代理和检查控制台命令
class AppKernel { ... public function registerBundles() { $bundles = array( ... new Tedivm\StashBundle\TedivmStashBundle(), new Jadu\InspectableStashBundle\InspectableStashDriverBundle(), ... ); return $bundles; } ... }
您还需要配置要使用的 Memcached 服务,例如(添加到 config.yml
)
inspectable_stash_driver: memcached_service: my_vendor.caching.memcached_service_id
该服务需要是内置的 Memcached
类 的实例。
检查缓存数据
您可以使用控制台命令
app/console dump:stash:cache
来获取 Stash 存储的所有键的列表。如果您需要筛选出仅匹配特定模式的键,您可以提供正则表达式,例如
app/console dump:stash:cache --grep 'some/prefix.*later'
。最后,如果您还需要查看每个缓存条目的值,只需添加 --with-values
选项,如下所示
app/console dump:stash:cache --grep 'some/prefix.*later' --with-values
。可以使用或不使用 --grep
选项使用 --with-values
。