定制 adlogix/zf2-opensoft-rollout 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adlogix/zf2-opensoft-rollout

Composer 安装命令:

composer require adlogix/zf2-opensoft-rollout

包简介

ZF2 module for the Opensoft Rollout library

README 文档

README

Build Status Scrutinizer Code Quality Total Downloads License composer.lock Latest Stable Version

A ZF2 Module for opensoft/rollout

Installation

  1. Install the module via composer by running:
composer require adlogix/zf2-opensoft-rollout:~1.0
  1. Add the Adlogix\Zf2Rollout module to the module section of your config/application.config.php

Configuration

Rollout parameters can be defined in the application configurations:

<?php
return [
    'rollout' => [

        // Service id to obtain a Opensoft\Rollout\RolloutUserInterface instance
        'user_service' => null,

        // Service id to obtain a Opensoft\Rollout\Storage\StorageInterface instance
        'storage_service' => 'zf2_rollout_storage_array',

        // Required configuration if storage service is Adlogix\Zf2Rollout\Storage\ZendDbAdapterStorage
        'zend_db_storage' => [
            'table_name' => 'rollout_feature'
        ],

        // Required configuration if storage service is Adlogix\Zf2Rollout\Storage\Doctrine\DoctrineORMStorage
        'doctrine_storage' => [
            'class_name' => SomeFeatureEntity::class
        ],
        
        // (Optional) Describes the features with a description
        'features' => [
            'feature_1' => [
                'description' => 'The description of the feature.' 
            ]
        ]
    ],
]

Usage

To retrieve the rollout service from a zend controller:

<?php

$rollout = $this->getServiceLocator()->get('zf2_rollout');

Refer to the documentation of opensoft/rollout for more information on how to use the library.

Describe the features

Since the Rollout library doesn't have (yet) a functionality to describe its feature flags, you can define them through this module. To do so, simply add your feature flag identifier in the 'features' sections of the rollout configuration as shown here:

<?php
return [
    'rollout' => [
        
        // (Optional) Describes the features with a description
        'features' => [
            'feature_1' => [
                'description' => '' 
            ]
        ]
    ],
];

To display the description in a view you have to call the view helper : rollout_description. If the description is not found in the configuration, an empty string will be returned.

echo $this->rollout_description('feature_1');

Zend Developer Toolbar

The module comes with support for the zend developer toolbar.

zf2-adlogix-rollout zend developer tools

⚠️ The ZDT rollout comes with a quick toggling action, allowing the user to quickly enable/disable a feature by clicking on one of the listed feature elements in the toolbar. Make sure to only authorise these actions in development mode. ⚠️

An example of enabling the end points with BjyAuthorize:

<?php

// config/autoload/authorization.development.php

use Adlogix\Zf2Rollout\Service\Controller\RolloutController;

return [
    'bjyauthorize' => [

        'guards' => [

            // Add this if you are adding guards on controllers
            'BjyAuthorize\Guard\Controller' => [
                ['controller' => RolloutController::class, 'roles' => ['guest','user']],
            ],

            // Add this if you are adding guards on routes
            'BjyAuthorize\Guard\Route' => [
                ['route' => 'rollout_feature_toggle', 'roles' => ['guest','user']],
            ],
        ],

    ],
];

adlogix/zf2-opensoft-rollout 适用场景与选型建议

adlogix/zf2-opensoft-rollout 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.11k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2016 年 09 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「zf2」 「flags」 「feature」 「feature flags」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 adlogix/zf2-opensoft-rollout 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 adlogix/zf2-opensoft-rollout 我们能提供哪些服务?
定制开发 / 二次开发

基于 adlogix/zf2-opensoft-rollout 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7.11k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 15
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-22