pantheon-systems/pantheon-edge-integrations
最新稳定版本:v1.1.0
Composer 安装命令:
composer require pantheon-systems/pantheon-edge-integrations
包简介
Helper class for content personalization.
README 文档
README
Archived project
This project is archived as of August 2024 as it no longer receives active development. The architecture provided by the tools in this SDK and the related projects are still valid and will continue to work on Pantheon AGCDN. However, we will not be responding to issues or pull requests or building these tools out more than they are already.
Pantheon Edge Integrations is a PHP library which uses header data to provide a personalization object, to be used for personalizing content for each user.
Installation
Pantheon Edge Integrations can be installed via Composer from Packagist...
composer require pantheon-systems/pantheon-edge-integrations
Usage
To make use of the PHP library, ensure PHP can use the class. After which, it's possible to etiher call the library through instanced methods, or through the global methods.
use Pantheon\EI\HeaderData;
Instanced Methods
Once the class is available, headerData objects can be instantiated to make use of the API and methods can be called on it.
$headerData = new HeaderData();
getHeader($key)
Uses header key to return raw header data.
$headerData->getHeader('Audience'); // => "geo:US" $headerData->getHeader('Interest'); // => "27" $headerData->getHeader('Role'); // => "subscriber"
parseHeader($key)
Uses header key to return parsed header data array.
$headerData->getHeader('Audience'); // => [geo => US] $headerData->getHeader('Interest'); // => [0 => 27] $headerData->getHeader('Role'); // => "subscriber"
returnPersonalizationObject()
Returns an array with personalization data.
$headerData->returnPersonalizedObject(); // => [ // Audience => [ geo => US ] // Interest => [ 0 => 27 ] // Role => subscriber // ]
returnVaryHeader($key)
Returns vary header array, based on header data.
Global Methods
There are also static methods defined within the class to help assist in retrieving data without having to instantiate the object yourself.
HeaderData::personalizationObject()
Gets the global personalizaition object.
Pantheon\EI\HeaderData::personalizationObject(); // => [ // Audience => [ geo => US ] // Interest => [ 0 => 27 ] // Role => subscriber // ]
HeaderData::parse($key)
Parses a global header by key using a specified regex.
Pantheon\EI\HeaderData::parse('Audience'); // => [geo => US]
HeaderData::header($key)
Gets the global header data based on the given key.
Pantheon\EI\HeaderData::header('Audience'); // => geo:US
HeaderData::varyHeader()
Returns vary header array based on the global data.
Pantheon\EI\HeaderData::varyHeader('geo');
Development
PHPUnit is used to run the tests.
composer install
composer test
pantheon-systems/pantheon-edge-integrations 适用场景与选型建议
pantheon-systems/pantheon-edge-integrations 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.41k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2022 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 pantheon-systems/pantheon-edge-integrations 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pantheon-systems/pantheon-edge-integrations 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 17
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-24