mablae/time-window-bundle
Composer 安装命令:
composer require mablae/time-window-bundle
包简介
Symfony bundle for time based feature flags
README 文档
README
This bundle implements implements basically daytime based feature flags.
NOTICE This bundle is the result of quickly decoupling some logic we already had duplicated in serveral places of an legacy codebase. If you are looking for a full featured Feature Toggle Bundle for Symfony you are probably better using https://github.com/qandidate-labs/qandidate-toggle-bundle
Feel free to contribute or leave feedback in the issues. <3
##Installation
Step 1: Install DatetimepickerBundle
php composer.phar require mablae/datetimepicker-bundle
Step 2: Enable the bundle
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Mablae\TimeWindowBundle\MablaeTimeWindowBundle(), ); }
Step 3: Configure your named time windows:
# app/config/config.yml mablae_time_window_: enabled: ~ time_windows: in_the_morning: - { startTime : '06:00' , endTime: '08:00' }
At the moment there is no proper overlapping checks or sorting. The timewindow must be defined in correct order. The first timewindow that returns active wins.
Step 4: Use the voter service to ask, if a time-window is active
<?php /* ... */ $timeWindowService = $this->get('mablae_time_window.service'); $itsInTheMorning = $timeWindowService->isTimeWindowActive('in_the_morning')
统计信息
- 总下载量: 2.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-29