open-resource-manager/client-php
Composer 安装命令:
composer require open-resource-manager/client-php
包简介
ORM client library for php.
README 文档
README
Install
Install with composer.
composer require open-resource-manager/client-php ~1.0
Usage
Docs:
The API documentation is available here.
Example:
<?php use Exception; use OpenResourceManager\ORM; use OpenResourceManager\Client\Account as AccountClient; class SomeClass { function someFunction () { // API environment variables $apiSecret = '123456789'; $apiHost = 'localhost'; $apiPort = 80; $apiVersion = 1; $useHttps = false; // Build the ORM connection $orm = new ORM($apiSecret, $apiHost, $apiVersion, $apiPort, $useHttps); // Build an account client $accountClient = new AccountClient($orm); // Get an ORM Account $response = $accountClient->getFromUsername('skywal'); // Verify that the API returned a 200 http code if ($response->code == 200) { // Get the account from the response body $account = $response->body->data; } else { // Throw an exception if we did not get 200 back // display the http code with the message from the API. throw new Exception($response->body->message, $response->code); } } }
统计信息
- 总下载量: 200
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-27