dreadlabs/kunstmaan-distributed-bundle

此包已被废弃,不再维护。未建议替代包。

为在分布式基础设施上运行 Kunstmaan CMS 设置并使用合理的默认值。

安装: 62

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 1

类型:symfony-bundle

0.4.5 2016-11-03 10:28 UTC

This package is not auto-updated.

Last update: 2020-01-24 16:10:57 UTC


README

为在分布式、集群基础设施上运行的 Kunstmaan Bundles CMS 实例配置。

它做什么?

  1. 包安装

    为了在分布式基础设施上运行,选择了 Redis 作为各种缓存的后端。

    snc/redis-bundle
    predis/predis
    
  2. 编译器遍历

    • 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
{
}