composer support

This commit is contained in:
Evgeny Zinoviev 2022-12-10 22:07:11 +03:00
parent 6ed0e6e9cf
commit 55ad6b4fad
5 changed files with 40 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/vendor/
/.idea

View File

@ -4,9 +4,18 @@
Полезно для автоматизации, если у вас много доменов/поддоменов.
## Установка
```shell
composer require ch1p/php-fastdns
```
## Использование
```php
use ch1p\FastDNS;
use ch1p\FastDNSException;
$fastdns = new FastDNS();
try {
// авторизуемся

21
composer.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "ch1p/php-fastdns",
"description": "FastVPS DNS API Client",
"type": "library",
"license": "BSD-2c",
"authors": [
{
"name": "Evgeny Zinoviev",
"email": "me@ch1p.io"
}
],
"require": {
"ext-curl": "*",
"ext-json": "*"
},
"autoload": {
"psr-4": {
"ch1p\\": "src/"
}
}
}

View File

@ -1,5 +1,7 @@
<?php
namespace ch1p;
class FastDNS {
const API_HOST = 'https://fastdns.fv.ee';
@ -302,6 +304,4 @@ class FastDNS {
return $response;
}
}
class FastDNSException extends Exception {}
}

5
src/FastDNSException.php Normal file
View File

@ -0,0 +1,5 @@
<?php
namespace ch1p;
class FastDNSException extends \Exception {}