lyhiving/dnspod_api 问题修复 & 功能扩展

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

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

lyhiving/dnspod_api

Composer 安装命令:

composer require lyhiving/dnspod_api

包简介

The DNSPod User API is restricted to individual users, making it easier and more flexible for users to manage their own domain names and records.

README 文档

README

Dnspod_API

The DNSPod User API OR DNSPod中文文档 is restricted to individual users, making it easier and more flexible for users to manage their own domain names and records.

dnspod

Need to cooperate with Curl extension

Installation

Use Composer to install the library. Of course, You can go to Packagist to view.

    $ composer require lyhiving/dnspod_api

Initialization parameter

  • Sample:
    require_once dirname(__FILE__) . '/vendor/autoload.php';
    use dnspod_api\Dnspod;
    $uid = 12345;
    $token = X12345;
    $DP = new Dnspod($uid, $token);

Add or modify records

  • Sample:
    $domain = 'example.com';
    $value = array(
        '255.255.255.1',
        '255.255.255.2',
        '255.255.255.3',
        );
    $name = 'www';
    $type = 'A';
    $DP->Records($domain, $value, $name, $type, true);

Copy A record

  • Sample:
    $domain = 'example.com';
    $DP->copyArecord($domain);

Get domain information

  • Sample:
    $copyDomain = 'google.com';
    $toDomain = 'example.com';
    echo $DP->getDomainInfo($copyDomain, $toDomain);

Get a list of records

  • Sample:
    $domain = 'example.com';
    echo $DP->getRecordList($domain);

Get details of batch tasks

  • Sample:
    $job_id = 'j12345';
    echo $DP->getBatchDetail($job_id);

Add a single record

  • Sample:
    $domain = 'example.com';
    $name = 'www';
    $value = '255.255.255.0';
    $type = 'A';
    echo $DP->addRecord($domain, $name, $value, $type);

Add records in bulk

  • Sample:
    $domain_id = '12345';
    $record[0] = array('name'=>'WWW', 'type'=>'A', 'value'='255.255.255.0', 'mx'=>1);
    echo $DP->batchAddRecord($domain_id, $record);

Modify record

  • Sample:
    $domain = 'example.com';
    $record_id = 'E12345';
    $name = 'WWW2';
    $value = '255.255.255.0';
    $type = 'A';
    $mx = 1;
    echo $DP->recordModify($domain, $record_id, $name, $value, $type, $mx);

Modify record

  • Sample:
    $domain = 'example.com';
    $record_id = 'E12345';
    echo $DP->recordRemove($domain, $record_id);

Other functions

  • Sample:
    //Get the API version number
    echo $DP->getVersion();
    
    //Get the level allowed line
    $domain = 'example.com';
    echo $DP->getRecordLine($domain);

    //Change API Region to Global Network And
    $DP->setRegion('global');

    //Change API Region to China Network
    $DP->setRegion('cn');
    
    //Get a list of domain names
    echo $DP->getDomainList();
    
    //Construct a new record table
    $name = 'example.com';
    $type = 'A';
    $value = '255.255.255.0';
    $DP->newRecords($name, $type, $value);

    //Remove share record
    $domain = 'example.com';
    $share_email = 'share@old.com';
    echo $DP->shareRemove($domain, $share_email);

Original author

weibo: yakeing

Modify by lyhiving

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MPL-2.0
  • 更新时间: 2019-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固