acquia/perz-api-php
最新稳定版本:0.1.5
Composer 安装命令:
composer require acquia/perz-api-php
包简介
A PHP Client library to consume the CIS API.
README 文档
README
Provides an API client for PHP applications communicating with the Acquia Personalization API .
Installation
Install the latest version with Composer:
$ composer require acquia/perz-api-php
Usage
Create the API Client
use Acquia\PerzApiPhp\ObjectFactory; use Acquia\PerzApiPhp\PerzApiPhpClient; $base_uri = 'https://personalization.api.endpoint'; $api_key = 'XXXXXX'; $secret_key = 'XXXXXXXXXXXXXXXX'; $key = ObjectFactory::getAuthenticationKey($api_key, $secret_key); $middleware = ObjectFactory::getHmacAuthMiddleware($key); $config = ['base_url' => $base_uri]; $api_client = new PerzApiPhpClient($middleware, $config);
Create entities in Personalization
/** * Create entity in Personalization. * * @param array $data * An array of Entity data. * $data = [ * 'account_id' => (string) Acquia Account ID. Required. * 'origin' => (string) Site ID. Required. * 'environment' => (string) Site envireonment. Required. * 'domain' => (string) Site Domain. Required. * 'entity_variations' => (array) Entity variation data. Required. * 'site_hash' => (string) Site hash. Optional. * ]. * * @return \Psr\Http\Message\ResponseInterface|void * Response. * * @throws \GuzzleHttp\Exception\GuzzleException * Guzzle Exception. */ $response = $api_client->putVariations($data);
Delete entities from Personalization.
/** * Delete entities from Personalization. * * @param array $data * An array of Entity data. * $data = [ * 'account_id' => (string) Acquia Account ID. Required. * 'environment' => (string) Site environment. Required. * 'origin' => (string) Site ID. Optional. * 'content_uuid' => (string) UUID of the entity. Optional. * 'language' => (string) UUID of the entity. Optional. * 'view_mode' => (string) UUID of the entity. Optional. * 'site_hash' => (string) Site hash. Optional. * ]. * * @return \Psr\Http\Message\ResponseInterface|void * Response. * * @throws \GuzzleHttp\Exception\GuzzleException * Guzzle Exception. */ $response = $api_client->getEntities($data);
Get entities from Personalisation.
<?php /** * Get entities from Personalisation. * * @param array $data * An array of Entity data. * $data = [ * 'account_id' => (string) Acquia Account ID. Required. * 'origin' => (string) Site ID. Required. * 'environment' => (string) Site environment. Required. * 'language' => (string) Entity Language. Optional. * 'view_mode' => (string) View mode of Entity. Optional. * 'q' => (string) Keywords to search. Optional. * 'content_type' => (string) Type of the Entity. Oprional. * 'tags' => (string) Tags to search, Optional. * 'all_tags' => (string) All tags to search. Optional. * 'date_start' => (datetime) Start date of Entity update. Optional. * 'date_end' => (datetime) End date of Entity update. Optional. * 'rows' => (integer) Number of rows in result. Default 10. Optional. * 'start' => (integer) Page start index. Default 0. Optional. * 'sort' => (string) Sort by field. Default modified. Optional. * 'sort_order' => (string) Sort order. Default desc. Optional. * 'site_hash' => (string) Site hash. Optional. * ]. * * @return \Psr\Http\Message\ResponseInterface|void * Response. * * @throws \GuzzleHttp\Exception\GuzzleException * Guzzle Exception. */ $response = $api_client->getEntities($data);
acquia/perz-api-php 适用场景与选型建议
acquia/perz-api-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 415.55k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 acquia/perz-api-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 acquia/perz-api-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 415.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-01-04