dknx01 / feature-flag-bundle
实现特性标志设计模式的包
dev-master
2016-08-19 19:57 UTC
Requires
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ~2.5
- monolog/monolog: ~1.11
- symfony/symfony: ^2.8
Requires (Dev)
- phpmetrics/phpmetrics: ^1.10
- phpunit/php-code-coverage: ^4.0
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2024-09-10 10:17:29 UTC
README
此 Symfony Bundle 提供了特性标志服务。
安装
#!bash
composer require dknx01/feature-flag-bundle
配置 parameters.yml
#!yml
dknx01_feature_flags:
handler: ~
flags: { }
如果您想使用 GUI,请更新 routing.yml
#!yml
imports:
resource: "@FeatureFlagBundle/Resources/config/routing.yml
需求
- Symfony 2.8.*
- [Doctrine 2.4.*](如果您想使用数据库存储标志配置)
配置
YAML 文件
#!yml
dknx01_feature_flags
handler: ~
flags:
foo:
ip: ~
date: ~
time:
start: '15:00:00'
environment: ~
sapi: ['cli']
sapi_negation: true
bar:
ip: 127.0.0.1
date:
startDate: ~
endDate: ~
# Dependencies #
* symfony/symfony: ^2.8
* doctrine/orm: ~2.5
* doctrine/doctrine-bundle: ~1.4
* monolog/monolog: ~1.11
# Database configuration #
Nothing special, just the normal Doctrine configuration [Symfony Databases and Doctrine](https://symfony.com.cn/doc/2.8/doctrine.html).
It will create it own table if the method "getAllFlags" is used (e.g. calls the GUI) and the database handler is used.
# GUI #
A very simple GUI is available at the following route:
feature_flag_homepage: /_featureflags
Example: http://YOUR.DOMAIN/_featureflags
# Usage #
!php
$this->getContainer()->get('feature_flag.flag')->isActive('bar');
# Wiki #
For more see the [Wiki](https://bitbucket.org/dknx01/featureflagbundle/wiki/)