pananames/php-api-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pananames/php-api-client

最新稳定版本:v1.0.2

Composer 安装命令:

composer require pananames/php-api-client

包简介

PHP client for Pananames APIv2

README 文档

README

  • API version: 1.0.0

    This package introduces APIv2 for Pananames services using PHP 7.x. PHP8.x version will follow shortly.

Requirements

PHP 7.1 - 8.1

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
	"require": {
		"pananames/php-api-client": "^1.0"
	}
}

or run composer require pananames/php-api-client.

Usage

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use Pananames\Api\Client;

// Create client
$client = Client::make('example95-8888-11e0-a7e8-04aafc84test');

try {
    // Get current balance.
    $response = $client->account()->getBalance();

    // Get paged list of domains available in your account.
    $response = $client->domains()->getList();

    // Get name server records.
    $response = $client->nameServers()->getDnsRecords('newexample.xyz');

    // Get full list of available TLDs.
    $response = $client->other()->getTlds();

    // Get current redirect URL.
    $response = $client->redirect()->getRedirect('newexample.xyz');

    // Get active transfers in.
    $response = $client->transferIn()->getTransfersList(1, 20);

    // Init transfer out.
    $response = $client->transferOut()->initTransferOut('newexample.xyz');

    // Get WHOIS information.
    $response = $client->whois()->getWhois('newexample.xyz', true);
} catch (Exception $e) {
    echo "Error: ". $e->getMessage() . "\n";
}

The following list introduces main Pananames entities you can use:

  • Account
  • Domains
  • NameServers
  • Other
  • Redirect
  • TransferIn
  • TransferOut
  • Whois

All the classes are fully described in src/V2/Entities/ directory. Description of response objects can be found in src/V2/Schemas/.

Also you can find all usage examples in src/Examples.

Testing

Tests are implemented in tests/ directory, and utilize PHPUnit and PHPStan dev dependencies.

./vendor/bin/phpunit

./vendor/bin/phpstan analyse

统计信息

  • 总下载量: 1.73k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-15