定制 ocolin/wisdm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ocolin/wisdm

最新稳定版本:v3.0.1

Composer 安装命令:

composer require ocolin/wisdm

包简介

REST Client for WISDM Wireless API

README 文档

README

What is it?

This is a PHP REST client for the WISDM API interface. WISDM is a service for wireless ISPs that provide the ability to determine which areas are serviceable from a wireless access point.

Table of Contents

Requirements

  • ^PHP 8.2
  • guzzlehttp/guzzle ^7.10
  • ocolin/global-type ^2.0

Installation

composer require ocolin/wisdm

Configuration

Wisdm requires two pieces of information. The server hostname, and your authentication token/key. These can be configured via environment or though constructor arguments using a Config data object.

Environment name Constructor argument Type Description
WISDM_API_HOST $host string Server hostname
WISDM_API_KEY $token string Authentication key/token

Instantiation with environment variables

// Manual variables for demonstration
$_ENV['WISDM_API_HOST'] = 'https://wisdm.wirelesscoverage.com/api';
$_ENV['WISDM_API_KEY'] = 'abcdefg';
$wisdm = new Ocolin\Wisdm\Wisdm();

Instantiation with constructor arguments

$wisdm = new Ocolin\Wisdm\Wisdm(
    config: new Ocolin\Wisdm\Config(
         host: 'https://wisdm.wirelesscoverage.com/api',
        token: 'abcdefg'
    );
);

Optional arguments

You can also pass along Guzzle HTTP configuration options such as HTTP timeouts, verification of SSL, etc different from the defaults.

// Manual variables for demonstration
$_ENV['WISDM_API_HOST'] = 'https://wisdm.wirelesscoverage.com/api';
$_ENV['WISDM_API_KEY'] = 'abcdefg';
$wisdm = new Ocolin\Wisdm\Wisdm(
    config: new Ocolin\Wisdm\Config( options: [ 'timeout' => 60 ] )
);

Response

The client responds with an object containing the following properties:

Name Type Description
status integer HTTP status code
statusMessage string HTTP status message
headers array HTTP response headers
contentType string HTTP body content type
body object|array API payload body

Path Parameter Interpolation

Any elements or properties of a $query argument that match variable tokens in the URI endpoint path will be replaced with the values for those elements in the $query array or object. Please see some of the method functions for examples.

Methods

GET

Get a resource from the API.

$output = $wisdm->get( 
    endpoint: '/availability/{id}/check', query: [ 'id' => 1234 ] 
);

POST

Create a resource on the API.

$output = $wisdm->post(
    endpoint: '/networks',
    body: [
        'name'  => 'MySiteName',
        'color' => '#808080'
    ]
);

PATCH

Update a resource on the API.

$output = $widnm->patch(
    endpoint: '/networks/{id}',
    query: [ 'id' => 1234 ],
    body: [ 'name' => 'MyNewSiteName' ]
);

DELETE

Delete a resource on the API.

$output = $wisdm->delete(
    endpoint: '/networks/{id}',
    query: [ 'id' => 1234 ]
);

REQUEST

In case changes are made to the API, a generic request function is available.

$output = $wisdm->request(
     endpoint: '/availability/{id}/check',
       method: 'GET',
        query: [ 'id' => 1234 ] 
);

UPLOAD

Several API calls use a multi-part request body for uploading files and data. The uploads() function can be used for those.

$output = $wisdm->upload(
    endpoint: '/networks/import-networks',
    filePath: __DIR__ . '/sites_template.csv',
    body: [
        'colour' => '#808080',
        'site_name_field' => 'Site_Name'
    ]
);

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固