primeinc/

edgeapi

EdgeOS API 的 PHP 封装器

dev-master / 0.1.x-dev 2015-06-18 00:51 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:00:01 UTC


README

EdgeOS API 的 PHP 封装器

安装

  1. 使用 Composer 将 EdgeAPI 安装到您的项目中

    composer require primeinc/edgeapi
  2. 设置端点和 Guzzle 客户端

    //create new endpoint config, with required info
    $endpoint = new \PrimeInc\EdgeApi\Endpoint(array(
        'protocol' => 'https',
        'domain' => '192.168.1.1',
        'port' => '443',
        'username' => 'ubnt',
        'password' => 'ubnt',
        // don't have a valid cert? set the following to false
        'verify' => true
    ));
    $client = new \PrimeInc\EdgeApi\Client($endpoint);
    $client->data('sys_info');
    
    echo $client->prettyJson(); // this will grab the last data fetched automatically

    有关更多选项,请查看 examples/ 中的 示例文件 以了解事物的工作原理。如果您不想使用此库,还有一个独立的模板。

待办事项

  • 捕获和处理错误
  • 编写测试
  • 通过 POST 请求更改端点配置的能力