edtownend / locklizard-admin-api
LockLizard Enterprise v4 API包装器
dev-master
2017-10-17 14:34 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-23 15:41:04 UTC
README
LockLizard Enterprise v4 API的包装器,使得API调用更加便捷。
功能
- 解析LockLizard的极其复杂响应格式,返回关联数组
- 自动处理包含超过200个ID的请求数据块
- 模拟一些LockLizard API中不存在的方法,例如替换访问规则,而不仅仅是添加或删除
待办事项(欢迎提交PR)
- 出现错误时抛出异常
- 编写测试
- 改进send和sendPost方法?
- 可能通过抓取管理员界面添加更多方法?通过API无法获取激活数量...
使用方法
<?php
$api = new LockLizardAdminAPI($server_url, $username, $password);
$customers = $api->listCustomer('email', 'john@example.com');
// $customers = [
// 'status' => 'OK', 'data' => [
// 'id' => 'xxx',
// 'name' => 'xxx',
// 'email' => 'xxx',
// 'company_name' => 'xxx',
// 'valid_from' => 'xxx',
// 'expires_at' => 'xxx',
// 'licenses' => 'xxx',
// 'active' => 'xxx',
// 'registered' => 'xxx'
// ]
// ];
?>
方法
查看代码 - 代码注释较为详细。
许可证
在MIT许可证下发布