dwo/flagging_bundle

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

:待办事项

v0.2.9 2016-11-10 18:35 UTC

This package is not auto-updated.

Last update: 2023-04-01 09:55:15 UTC


README

Build Status Coverage Status

FeatureFlaggingBundle

:待办事项

自用功能管理器

替换功能管理器

dwo_flagging:
    manager:
        feature: my_services.flagging_manager
use Dwo\Flagging\Model\FeatureManagerInterface;

class MyFlaggingManager implements FeatureManagerInterface {
    ...
}

动态功能

动态功能最佳案例是数据库和缓存层。以 DoctrineCacheBundle 为例。此案例使用 php 文件缓存和 dbal 连接。

使用 DoctrineCacheBundle

  1. composer install
composer require doctrine/doctrine-cache-bundle
  1. 将 Bundle 添加到 Kernel
// app/AppKernel.php
public function registerBundles()
{
    // ...
    $bundles[] = new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle();

    return $bundles;
}
  1. 包含配置
imports:
    - { resource: @DwoFlaggingBundle/Resources/config/dwo_flagging.yml }
  1. 替换功能管理器
  manager:
    feature: dwo_flagging.manager.feature.cache

缓存清除

要清除缓存,请使用 DoctrineCacheBundle FlushCommand

php app/console doctrine:cache:flush flagging