twentytwo-labs / api-service-feature-flag
用于管理功能标志的包
1.0.0
2024-09-25 16:19 UTC
Requires
- php: >= 8.1
- symfony/options-resolver: ^5.4 || ^6.0 || ^7.0
- twentytwo-labs/api-service-bundle: *
- twentytwo-labs/feature-flag-bundle: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- infection/infection: ^0.29
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^10.0|^11.0
- squizlabs/php_codesniffer: ^3.10
- symfony/security-bundle: ^5.4|^6.0|^7.0
README
使用 ApiServiceBundle 来存储 Twentytwo Labs 功能标志。
配置
# config/packages/twentytwo_labs_feature_flag.yaml
twentytwo_labs_feature_flag:
managers:
admin:
factory: twenty-two-labs.feature-flags.factory.api-service
options:
client: 'API_SERVICE_ID'
collection:
operationId: COLLECTION_OPERATION_ID
mapper: #optional
page: page #default
params:
accept: 'application/hal+json'
itemsPerPage: 30
item:
operationId: ITEM_OPERATION_ID
mapper:
identifier: IDENTIFIER
其中
API_SERVICE_ID
是以@
开头的 api 服务 IDCOLLECTION_OPERATION_ID
是获取所有功能的操作 IDITEM_OPERATION_ID
是通过标识符获取单个功能的操作 IDIDENTIFIER
是 HTTP 响应中的一个字段