dns-zone-configurator
所属分类:collect
开发工具:PHP
文件大小:0KB
下载次数:0
上传日期:2023-05-15 15:35:51
上 传 者:
sh-1993
说明: Php库,用于以编程方式解析和编辑具有高级抽象的dns区域文件。
(Php library for parsing and editing dns zones files programmatically with high level abstraction.)
文件列表:
LICENSE (1076, 2023-05-15)
composer.json (767, 2023-05-15)
dns/ (0, 2023-05-15)
dns/zones/ (0, 2023-05-15)
dns/zones/zone.conf (1305, 2023-05-15)
dns/zones/zone_node_names.conf (176, 2023-05-15)
dns/zones/zone_node_names_numeric.conf (70, 2023-05-15)
phpdox.xml (758, 2023-05-15)
phpunit.xml (755, 2023-05-15)
src/ (0, 2023-05-15)
src/LTDBeget/ (0, 2023-05-15)
src/LTDBeget/dns/ (0, 2023-05-15)
src/LTDBeget/dns/configurator/ (0, 2023-05-15)
src/LTDBeget/dns/configurator/Zone.php (5941, 2023-05-15)
src/LTDBeget/dns/configurator/deserializer/ (0, 2023-05-15)
src/LTDBeget/dns/configurator/deserializer/ArrayDeserializer.php (4384, 2023-05-15)
src/LTDBeget/dns/configurator/deserializer/PlainDeserializer.php (569, 2023-05-15)
src/LTDBeget/dns/configurator/errors/ (0, 2023-05-15)
src/LTDBeget/dns/configurator/errors/ErrorsStore.php (1174, 2023-05-15)
src/LTDBeget/dns/configurator/errors/ValidationError.php (3823, 2023-05-15)
src/LTDBeget/dns/configurator/traits/ (0, 2023-05-15)
src/LTDBeget/dns/configurator/traits/RecordsIterateTrait.php (1943, 2023-05-15)
src/LTDBeget/dns/configurator/validators/ (0, 2023-05-15)
src/LTDBeget/dns/configurator/validators/CnameNumberCheck.php (571, 2023-05-15)
src/LTDBeget/dns/configurator/validators/ConflictTypesValidator.php (1270, 2023-05-15)
src/LTDBeget/dns/configurator/validators/DnsZoneDomainNameValidator.php (973, 2023-05-15)
src/LTDBeget/dns/configurator/validators/HostnameValidator.php (1873, 2023-05-15)
src/LTDBeget/dns/configurator/validators/Int16Validator.php (385, 2023-05-15)
src/LTDBeget/dns/configurator/validators/Int32Validator.php (394, 2023-05-15)
src/LTDBeget/dns/configurator/validators/Ip4Validator.php (428, 2023-05-15)
src/LTDBeget/dns/configurator/validators/Ip6Validator.php (428, 2023-05-15)
src/LTDBeget/dns/configurator/validators/OutOfZoneDataValidator.php (745, 2023-05-15)
src/LTDBeget/dns/configurator/validators/PtrValidator.php (901, 2023-05-15)
src/LTDBeget/dns/configurator/validators/SoaNotInRootValidator.php (503, 2023-05-15)
src/LTDBeget/dns/configurator/validators/SoaNumberCheck.php (566, 2023-05-15)
src/LTDBeget/dns/configurator/validators/TtlValidator.php (408, 2023-05-15)
src/LTDBeget/dns/configurator/zoneEntities/ (0, 2023-05-15)
src/LTDBeget/dns/configurator/zoneEntities/Node.php (5270, 2023-05-15)
... ...
# dns-zone-configurator
[![Latest Stable Version](https://poser.pugx.org/ltd-beget/dns-zone-configurator/version)](https://packagist.org/packages/ltd-beget/dns-zone-configurator)
[![Total Downloads](https://poser.pugx.org/ltd-beget/dns-zone-configurator/downloads)](https://packagist.org/packages/ltd-beget/dns-zone-configurator)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/LTD-Beget/dns-zone-configurator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/LTD-Beget/dns-zone-configurator/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/LTD-Beget/dns-zone-configurator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/LTD-Beget/dns-zone-configurator/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/LTD-Beget/dns-zone-configurator/badges/build.png?b=master)](https://scrutinizer-ci.com/g/LTD-Beget/dns-zone-configurator/build-status/master)
[![Documentation](https://img.shields.io/badge/code-documented-brightgreen.svg)](http://ltd-beget.github.io/dns-zone-configurator/documentation/html/index.html)
[![Documentation](https://img.shields.io/badge/code-coverage-brightgreen.svg)](http://ltd-beget.github.io/dns-zone-configurator/coverage/)
[![License MIT](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/LTD-Beget/dns-zone-configurator/blob/master/LICENSE)
Php library for parsing and editing dns zones files programmatically with high level abstraction.
## Installation
```shell
composer require ltd-beget/dns-zone-configurator
```
## Usage
```php
iterateNodes() as $node) {
$node->getName();
$node->getZone();
}
// or get concrete node
if($zone->isNodeExist("node.name")) {
$node = $zone->getNode("node.name");
$node->getName();
$node->getZone();
}
// also you can iterate via resource records in zone
foreach ($zone->iterateRecords() as $record) {
$record->getType();
$record->getTtl();
$record->getNode();
}
// or iterate in node
if($zone->isNodeExist("node.name")) {
$node = $zone->getNode("node.name");
foreach ($node->iterateRecords() as $record) {
$record->getType();
$record->getTtl();
$record->getNode();
}
}
// or iterate only concrete records in zone or node
foreach ($zone->iterateA() as $record) {
$record->getAddress();
$record->getType();
$record->getTtl();
$record->getNode();
}
// all records can be modified
foreach ($zone->iterateNs() as $record) {
$record->setNsdName("new.nsd.name.");
}
// or they can be deleted
foreach ($zone->iterateMx() as $record) {
$record->remove();
}
// zone can be validate
if(! $zone->validate()) {
// and if any errors, you can see them as array
$zone->getErrorsStore()->toArray();
// or can iterate via all, and remove invalid records for example
foreach ($zone->getErrorsStore()->iterate() as $error) {
if($error->isHasRecord()) {
$error->getRecord()->remove();
}
}
}
// You can print zone as string, to put in in real zone file
$content = (string) $zone;
file_put_contents(__DIR__."/dns/zones/zone.conf", $content);
// Or you can store it in array format
$array_content = $zone->toArray();
// and make zone again from array format
Zone::fromArray("voksiv.ru.", $array_content);
// also you can make zone programmatically
$zone = new Zone("voksiv.ru.");
$node = $zone->getNode("@");
$node->getRecordAppender()->appendARecord("127.0.0.1");
$node->getRecordAppender()->appendNsRecord("google.com.");
```
### Dns zone file tokenize only
if you want only tokenize zone file you can use this [library](https://github.com/LTD-Beget/dns-zone-parser)
### Developers
## Regenerate documentation
```shell
$ ./vendor/bin/phpdox
```
### Run tests
```shell
$ php phpunit.phar --coverage-html coverage
```
## License
dns-zone-configurator is released under the MIT License.
See the [bundled LICENSE file](LICENSE) for details.
近期下载者:
相关文件:
收藏者: