aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-12-10 22:07:11 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-12-10 22:07:11 +0300
commit55ad6b4fad2aa8e4e941c40980bdc5afc406881b (patch)
tree809daf88bb5042a40d27ca8a813cdc9ce0879837
parent6ed0e6e9cf781f0be7601690f342098d79ab220c (diff)
composer support
-rw-r--r--.gitignore2
-rw-r--r--README.md9
-rw-r--r--composer.json21
-rw-r--r--src/FastDNS.php (renamed from FastDNS.php)6
-rw-r--r--src/FastDNSException.php5
5 files changed, 40 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f45219c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/vendor/
+/.idea \ No newline at end of file
diff --git a/README.md b/README.md
index de191c6..11e1d5e 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,18 @@
Полезно для автоматизации, если у вас много доменов/поддоменов.
+## Установка
+
+```shell
+composer require ch1p/php-fastdns
+```
+
## Использование
```php
+use ch1p\FastDNS;
+use ch1p\FastDNSException;
+
$fastdns = new FastDNS();
try {
// авторизуемся
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..70a1279
--- /dev/null
+++ b/composer.json
@@ -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/"
+ }
+ }
+}
diff --git a/FastDNS.php b/src/FastDNS.php
index f7c9736..7ee38cc 100644
--- a/FastDNS.php
+++ b/src/FastDNS.php
@@ -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 {} \ No newline at end of file
+} \ No newline at end of file
diff --git a/src/FastDNSException.php b/src/FastDNSException.php
new file mode 100644
index 0000000..c8690a4
--- /dev/null
+++ b/src/FastDNSException.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace ch1p;
+
+class FastDNSException extends \Exception {} \ No newline at end of file