destinations / destinations-client-core
此包的最新版本(dev-master)没有提供许可证信息。
Destinations PHP 客户端
dev-master
2021-08-13 04:29 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.4
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-09-17 18:54:29 UTC
README
此包为开发者提供了一套基础类和接口,用于构建可以连接目的地数据库的客户端。
该包设计用于扩展,以便与任何内容管理系统一起使用。一个例子是建立在之上的 Silverstripe 客户端。https://github.com/SilverStripers/destinations-client-silverstripe
安装
可以使用 composer 安装此模块。
composer require destinations/destinations-client-core
设置
如果您的 API 使用令牌进行安全保护,您可以使用以下方式设置它们
use DD\Client\Core\Client;
Client::set_key('YOUR_KEY_HERE');
连接到 API
客户端类中预定义了一些函数,可以帮助您查询数据库。
获取类别
use DD\Client\Core\Client;
$client = new Client('YOUR_KEY_HERE');
$categories = $client->getCategories();
foreach($categories as $category) {
// $category['ID'];
}