alexander.corrochano/php_wemust_driver

用于请求Wemust API的Web驱动接口

此包的官方仓库似乎已丢失,因此该包已被冻结。

v1.1 2020-08-24 02:39 UTC

This package is auto-updated.

Last update: 2023-07-14 04:51:35 UTC


README

安装

要安装此驱动程序,请运行以下命令,您将获得最新版本。

composer require alexander.corrochano/php_wemust_driver

如何使用

以下是一个使用示例。请务必使用您自己的凭据。

    $requestFactory = new RequestFactory(
        $baseUrl,       // Base url where Wemust API is deployed
        $serviceCode,   // The name of your app that must be register in Wemust API
        $clientID,      // The ID of your app (provided by wemust operator)
        $clientSecret   // The secret of your app (provided by wemust operator)
    );
    $requestService = new RequestService();
    $requestManager = new RequestManager($requestService);

    $wemust   = new WemustAPI($requestFactory, $requestManager);
    $response = $wemust('GetUserInfoByName', ['username' => 'ancalexander']);
    $status   = $response->getStatus(); // return 1 if there is no errors
    $data     = $response->getData();   // return an array with all data reported by Wemust API