sebastka/domeneshop-php
Composer 安装命令:
composer require sebastka/domeneshop-php
包简介
PHP library for working with the Domeneshop API
关键字:
README 文档
README
PHP library for working with the Domeneshop API.
Installation
composer require sebastka/domeneshop-php
Credentials
Use of this library requires Domeneshop API credentials.
See the Domeneshop API documentation for more information.
Examples
Operations on the first domain in your accout:
<?php require_once 'vendor/autoload.php'; $ds = new \Sebastka\Domeneshop\Client('YOUR_API_TOKEN', 'YOUR_API_SECRET_KEY'); $domain = $ds->domains->get()[0]; // Delete all _acme-challenge records $recordsToDelete = $domain->records->get(['type' => 'TXT', 'host' => '_acme-challenge']); foreach ($recordsToDelete as $record) $domain->records->delete($record); // Show all remaining records $allRecords = $domain->records->get(); foreach ($allRecords as $record) print_r($record->toArray()); // Add a new record: id, host, ttl, type, data, otherFields $new_record = new \Sebastka\Domeneshop\Record( NULL, '@', 3600, 'MX', 'mx.domain.tdl', [ 'priority' => 10 ] ); $domain->records->add($new_record); printf('Record ID: %d' . PHP_EOL, $new_record->getId()); // Update record $new_record->set('data', 'mx.domain.tld'); $new_record->set('priority', 20); $domain->records->update($new_record); // List HTTP forwards $forwards = $domain->forwards->get(); foreach ($forwards as $forward) print_r($forward->toArray()); ?>
To do
- Implement tests
- Implement class/resource abstraction
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-09