magentix/unopim-php-api-client
Composer 安装命令:
composer require magentix/unopim-php-api-client
包简介
Simple PHP UnoPim API Client
README 文档
README
Installation
composer require magentix/unopim-php-api-client
Usage
$apiUrl = 'https://www.example.com'; $clientId = '1a1b1c1d-2e2f-3g3h-4i4j-5k5l5m5n5o5p'; $clientSecret = '1a3b5c7d9e2f4g6h8i1j3k5l7m9n2o4p6q8r1s3t'; $username = 'john.doe@example.com'; $password = 'Password'; $cache = new \Magentix\UnoPimApiClient\UnoPimApiCache( __DIR__ . DIRECTORY_SEPARATOR . 'api_cache', // The cache file directory path 86400 // Request lifetime in seconds (GET requests in HTTP 200 are cached, 0 to disable) ); $client = new \Magentix\UnoPimApiClient\UnoPimApiClient( $apiUrl, $clientId, $clientSecret, $username, $password, $cache, 3000 // Authentication lifetime (need to be lower that the access token TTL, 0 to disable) );
GET
$result = $client->get('/api/v1/rest/categories');
$params = [ 'filters' => [ 'categories' => [ [ 'operator' => 'IN', 'value' => ['beers'] ] ] ], 'limit' => 10, ]; $result = $client->get('/api/v1/rest/products', $params);
POST
$data = [ 'code' => 'beers', 'parent' => 'root', 'additional_data' => [ 'locale_specific' => [ 'en_US' => ['name' => 'Beers'], 'fr_FR' => ['name' => 'Bières'], ] ] ]; $result = $client->post('/api/v1/rest/categories', $data);
PUT
$data = [ 'parent' => 'root', 'additional_data' => [ 'locale_specific' => [ 'en_US' => ['name' => 'Beers'], 'fr_FR' => ['name' => 'Bières'], ] ] ]; $result = $client->put('/api/v1/rest/categories/beers', $data);
magentix/unopim-php-api-client 适用场景与选型建议
magentix/unopim-php-api-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 magentix/unopim-php-api-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 magentix/unopim-php-api-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-02-17