fortresswire / fw-sdk-php
FortressWire SDK for PHP - 在您的PHP项目中使用FortressWire
dev-main
2021-05-29 16:28 UTC
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.2
This package is not auto-updated.
Last update: 2024-09-28 07:04:02 UTC
README
免责声明:这是一个正在进行中的工作
FortressWire SDK for PHP使开发者能够轻松地从PHP代码中与FortressWre进行交互。您可以通过安装SDK并通过Composer开始使用。
入门指南
-
最低要求 - 运行SDK,您的系统需要至少安装PHP 7.4版本和cURL扩展。
-
安装SDK - 使用Composer是安装FortressWire SDK for PHP的推荐方式。SDK可通过Packagist在
fortresswire/fw-sdk-php包下获取。如果Composer已在全球范围内安装,您可以在项目的根目录中运行以下命令将SDK作为依赖项添加:
composer require fortresswire/fw-sdk-php
快速示例
创建Watchdog客户端
require './vendor/autoload.php'; use FortressWire\Watchdog\WatchdogClient; $client = new WatchdogClient([ 'version' => '1', 'region' => 'af-south-1', 'key' => $_ENV['WATCHDOG_KEY'], ]);
创建Watchdog事件
... use FortressWire\Watchdog\WatchdogEvents; $logger = new WatchdogEvents($client); $logger->create('debug - low', 'Account registration failed.', [ 'first_name' => 'Donald', 'last_name' => 'Pakkies' ]);
创建MoanaDB客户端
require './vendor/autoload.php'; use FortressWire\Moana\MoanaClient; $client = new MoanaClient([ 'version' => '1', 'region' => 'af-south-1', 'key' => $_ENV['MOANA_KEY'], ]);
创建MoanaDB记录
... use FortressWire\Moana\Document; $document = new Document($client); $document->table('users')->create([ 'first_name' => 'Donald', 'last_name' => 'Pakkies', ]);
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。