okdewit/optimizely-php-sdk
Composer 安装命令:
composer require okdewit/optimizely-php-sdk
包简介
Optimizely SDK for Full Stack PHP projects.
关键字:
README 文档
README
This is a forked repository, published separately from the mainstream Optimizely SDK on packagist. It is tagged as a new Major Release v4.0.0, and depends on Monolog v2.0.0 to resolve a conflict with Laravel 7 and 8 which can not use Monolog v1.0.0.
Optimizely PHP SDK
This repository houses the PHP SDK for use with Optimizely Full Stack and Optimizely Rollouts.
Optimizely Full Stack is A/B testing and feature flag management for product development teams. Experiment in any application. Make every feature on your roadmap an opportunity to learn. Learn more at https://www.optimizely.com/platform/full-stack/, or see the documentation.
Optimizely Rollouts is free feature flags for development teams. Easily roll out and roll back features in any application without code deploys. Mitigate risk for every feature on your roadmap. Learn more at https://www.optimizely.com/rollouts/, or see the documentation.
Getting Started
Installing the SDK
The Optimizely PHP SDK can be installed through Composer. Please use the following command:
php composer.phar require optimizely/optimizely-sdk
Feature Management Access
To access the Feature Management configuration in the Optimizely dashboard, please contact your Optimizely account executive.
Using the SDK
Initialization
Create the Optimizely client, for example:
$optimizely = new Optimizely(<<DATAFILE>>);
Or you may also use OptimizelyFactory method to create an optimizely client using your SDK key, an optional fallback datafile and an optional datafile access token. Using this method internally creates an HTTPProjectConfigManager. See HTTPProjectConfigManager for further detail.
$optimizelyClient = OptimizelyFactory::createDefaultInstance("your-sdk-key", <<DATAFILE>>, <<DATAFILE_AUTH_TOKEN>>);
To access your HTTPProjectConfigManager:
$configManager = $optimizelyClient->configManager;
Or you can also provide an implementation of the ProjectConfigManagerInterface in the constructor:
$configManager = new HTTPProjectConfigManager(<<SDK_KEY>>); $optimizely = new Optimizely(<<DATAFILE>>, null, null, null, false, null, $configManager);
ProjectConfigManagerInterface
ProjectConfigManagerInterface exposes getConfig method for retrieving ProjectConfig instance.
HTTPProjectConfigManager
HTTPProjectConfigManager
is an implementation of ProjectConfigManagerInterface interface.
The fetch method makes a blocking HTTP GET request to the configured URL to download the
project datafile and initialize an instance of the ProjectConfig.
Calling fetch will update the internal ProjectConfig instance that will be returned by getConfig.
Use HTTPProjectConfigManager
$configManager = new HTTPProjectConfigManager(<<SDK_KEY>>);
SDK key
Optimizely project SDK key; required unless source URL is overridden.
A notification will be triggered whenever a new datafile is fetched and ProjectConfig is updated. To subscribe to these notifications, use the $notificationCenter->addNotificationListener(NotificationType::OPTIMIZELY_CONFIG_UPDATE, $updateCallback).
Documentation
See the Optimizely Full Stack developer documentation to learn how to set up your first Full Stack project and use the SDK.
Development
Unit tests
Running all tests
You can run all unit tests with:
./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING.
okdewit/optimizely-php-sdk 适用场景与选型建议
okdewit/optimizely-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 115.03k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 09 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sdk」 「optimizely」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 okdewit/optimizely-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 okdewit/optimizely-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 okdewit/optimizely-php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Optimizely PHP SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts
An Optimizely app for Strata
A server-side A/B testing tool for Laravel 5.
A server-side A/B/n testing tool
A/B testing tool for Laravel apps
A server-side A/B testing tool for Laravel.
统计信息
- 总下载量: 115.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-09-12