dreadlabs / kunstmaan-distributed-bundle
此包已被废弃,不再维护。未建议替代包。
为在分布式基础设施上运行 Kunstmaan CMS 设置并使用合理的默认值。
0.4.5
2016-11-03 10:28 UTC
Requires
- friendsofsymfony/http-cache-bundle: ~1.3.6
- kunstmaan/bundles-cms: ~3.6.0
- predis/predis: ~1.1.1
- snc/redis-bundle: ~2.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12.1
- pdepend/pdepend: ~2.2.4
- phploc/phploc: ~3.0.1
- phpmd/phpmd: ~2.4.3
- phpunit/phpunit: ~4.4
- sebastian/phpcpd: ~2.0.4
- squizlabs/php_codesniffer: ~2.7.0
README
为在分布式、集群基础设施上运行的 Kunstmaan Bundles CMS 实例配置。
它做什么?
-
包安装
为了在分布式基础设施上运行,选择了 Redis 作为各种缓存的后端。
snc/redis-bundle predis/predis
-
编译器遍历
-
kunstmaan_admin.cache
用 Redis 缓存替换文件系统缓存。
-
dreadlabs_kunstmaan_distibuted.cache_page_events.subscriber
注册一个 EventListener 用于页面缓存失效。
-
如何激活?
将以下包添加到您的 AppKernel
// ...
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new Snc\RedisBundle\SncRedisBundle(),
new DreadLabs\KunstmaanDistributedBundle\DreadLabsKunstmaanDistributedBundle(),
// ...
将以下容器参数添加到您的 parameters.yml.dist
# Set according to the valid clients which may purge the cache
http_cache_purge_client_ips: [127.0.0.1, ...]
# Host and port of the proxy server(s)
http_cache_proxy_servers: [localhost:80]
# Base-URL of the application
http_cache_proxy_baseurl: localhost
# Proxy client options
http_cache_proxy_options: { purge_method: '', ... }
# Change / customize if something prevents the custom HTTP Method
http_cache_purge_method: 'PURGE'
将以下配置键添加到您的 parameters.yml.dist
redis_host: localhost
redis_db_cache: 1
redis_db_annotations: 2
redis_db_http_cache: 3
redis_db_kunstmaanadmin_cache: 4
在您的 app/AppCache.php
中使用 Bundle 的 HttpCache
// app/AppCache.php
// ...
use DreadLabs\KunstmaanDistributedBundle\HttpCache\HttpCache;
class AppCache extends HttpCache
{
}