synerise/php-sdk
最新稳定版本:v0.7.1
Composer 安装命令:
composer require synerise/php-sdk
包简介
SDK allowing basic integration with Synerise API
README 文档
README
About
Synerise SDK for PHP. Allows access to Synerise APIs and overall integration.
Requirements
- A Synerise workspace API Key
- PHP 7.4+
Installing Synerise SDK with Composer
SDK is available over packagist. Some dependencies are optional and can be replaced with custom implementations
- You can install it with the following command:
composer require synerise/php-sdk
- Install suggested dependencies
composer require mobiledetect/mobiledetectlib
Initialization
The repository provides autogenerated api clients that can be utilized on their own.
There's also a single entry point ClientBuilder which helps to initialize and authorized all the apis.
Using ClientBuilder
ClientBuilder requires a Synerise\Sdk\Api\Config implementation, which would contain the set of api settings.
- Initializing the api with
ClientBuilder:
use Synerise\Sdk\Api\ClientBuilder; use Synerise\Sdk\Api\Config; /** @var Config $config implementation of Config interface */ $clientBuilder = new ClientBuilder($config);
- Optionally you can also provide your own RequestAdapter:
use Microsoft\Kiota\Abstractions\RequestAdapter; use Synerise\Sdk\Api\ClientBuilder; use Synerise\Sdk\Api\Config; /** * @var Config $config implementation of Config interface * @var RequestAdapter $requestAdapter implementation of RequestAdapter interface */ $clientBuilder = new ClientBuilder($config, $requestAdapter);
Token Caching
The SDK supports token caching to reduce authentication requests:
With PSR Cache (Recommended)
// Install cache implementation composer require symfony/cache use Symfony\Component\Cache\Adapter\RedisAdapter; use Synerise\Sdk\Api\Authentication\TokenProviderFactory; $cache = new RedisAdapter(RedisAdapter::createConnection('redis://localhost')); $tokenProvider = TokenProviderFactory::createWithPsrCache($config, $cache);
Changelog
Changelog can be found here.
Author
Synerise, developer@synerise.com. If you need support please feel free to contact us.
统计信息
- 总下载量: 6.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-01-09