Skip to content

Commit b38f229

Browse files
authored
Merge pull request #4 from BekoDesign/development
Development branch to Master
2 parents f6b2cdc + e226363 commit b38f229

59 files changed

Lines changed: 2308 additions & 18 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,75 @@
1+
# Created by https://www.gitignore.io/api/composer,phpstorm
2+
3+
### Composer ###
4+
composer.phar
15
/vendor/
2-
.env
6+
7+
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
8+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
9+
# composer.lock
10+
11+
### PhpStorm ###
12+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
13+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
14+
15+
# User-specific stuff:
16+
.idea/**/workspace.xml
17+
.idea/**/tasks.xml
18+
.idea/dictionaries
19+
20+
# Sensitive or high-churn files:
21+
.idea/**/dataSources/
22+
.idea/**/dataSources.ids
23+
.idea/**/dataSources.xml
24+
.idea/**/dataSources.local.xml
25+
.idea/**/sqlDataSources.xml
26+
.idea/**/dynamic.xml
27+
.idea/**/uiDesigner.xml
28+
.idea/**
29+
# Gradle:
30+
.idea/**/gradle.xml
31+
.idea/**/libraries
32+
33+
# CMake
34+
cmake-build-debug/
35+
36+
# Mongo Explorer plugin:
37+
.idea/**/mongoSettings.xml
38+
39+
## File-based project format:
40+
*.iws
41+
42+
## Plugin-specific files:
43+
44+
# IntelliJ
45+
/out/
46+
47+
# mpeltonen/sbt-idea plugin
48+
.idea_modules/
49+
50+
# JIRA plugin
51+
atlassian-ide-plugin.xml
52+
53+
# Cursive Clojure plugin
54+
.idea/replstate.xml
55+
56+
# Crashlytics plugin (for Android Studio and IntelliJ)
57+
com_crashlytics_export_strings.xml
58+
crashlytics.properties
59+
crashlytics-build.properties
60+
fabric.properties
61+
62+
### PhpStorm Patch ###
63+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
64+
65+
# *.iml
66+
# modules.xml
67+
# .idea/misc.xml
68+
# *.ipr
69+
70+
# Sonarlint plugin
71+
.idea/sonarlint
72+
73+
# End of https://www.gitignore.io/api/composer,phpstorm
74+
75+
.env

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[![Packagist](https://img.shields.io/packagist/v/BekoDesign/versioAPI.svg)]()
2+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
23

3-
# Versio-PHP-API
4-
PHP implementation of the new Restfull Versio API (https://www.versio.nl/RESTapidoc/)
4+
# Versio PHP API
5+
This is a PHP library for the new rest API of Versio (Hostingprovider) as described here: https://www.versio.nl/RESTapidoc/.
6+
7+
This library can manage Domains, Reseller Hosting Accounts, WebHosting Accounts and SSL certificates as well as managing
8+
and viewing the Categories, TLDS and Products of Versio.
59

610
## Installation
711

@@ -20,7 +24,7 @@ Download [release](https://github.com/bekodesign/Versio-PHP-API/releases "Github
2024

2125
## Usage
2226

23-
**@Todo:** Write documentation
27+
Please reference the [Wiki pages](https://github.com/BekoDesign/Versio-PHP-API/wiki) for the documentation.
2428

2529
## Testing
2630

@@ -36,13 +40,14 @@ VERSIO_HOST=versio.nl
3640
VERSIO_USERNAME={YOUR VERSIO USERNAME}
3741
VERSIO_PASSWORD={YOUR VERSIO PASSWORD}
3842
````
39-
Replace **{YOUR VERSIO USERNAME}** and **{YOUR VERSIO PASSWORD}** with the credentials you use to sign in at https://www.versio.nl/login?uri=/customer/
43+
Replace **{YOUR VERSIO USERNAME}** and **{YOUR VERSIO PASSWORD}** with the credentials you use to sign in
44+
at https://www.versio.nl/login?uri=/customer/
4045

4146
You can also change the host to versio.uk, versio.nl, versio.be, versio.eu. But the default fallback is versio.nl.
4247

4348
## License
4449

45-
This project is released under the [MIT][link-license] License.
50+
This project is released under the [MIT](https://github.com/beko1997/Versio-PHP-API/blob/master/LICENSE) License.
4651

4752
## Issues
4853

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "BekoDesign/versio-php-api",
2+
"name": "bekodesign/versio-php-api",
33
"description": "PHP implementation of the new Restfull Versio API",
44
"type": "library",
55
"license": "MIT",

lib/BekoDesign/versioAPI/Client.php

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33

44
use BekoDesign\versioAPI\Contracts\IClient;
55
use BekoDesign\versioAPI\Models\Category;
6+
use BekoDesign\versioAPI\Models\Contact;
7+
use BekoDesign\versioAPI\Models\DnsTemplate;
8+
use BekoDesign\versioAPI\Models\Domain;
9+
use BekoDesign\versioAPI\Models\Reseller;
10+
use BekoDesign\versioAPI\Models\ResellerPlan;
11+
use BekoDesign\versioAPI\Models\SSLApprover;
12+
use BekoDesign\versioAPI\Models\SSLCertificate;
13+
use BekoDesign\versioAPI\Models\SSLProduct;
14+
use BekoDesign\versioAPI\Models\TLD;
15+
use BekoDesign\versioAPI\Models\Webhosting;
16+
use BekoDesign\versioAPI\Models\WebhostingPlan;
617
use Http\Discovery\HttpClientDiscovery;
718
use Http\Message\Authentication;
819
use Http\Message\Authentication\BasicAuth;
@@ -69,6 +80,83 @@ public function categories() : Category {
6980
return new Category($this);
7081
}
7182

83+
/**
84+
* @return Contact
85+
*/
86+
public function contacts() : Contact {
87+
return new Contact($this);
88+
}
89+
90+
/**
91+
* @return DnsTemplate
92+
*/
93+
public function dnsTemplates() : DnsTemplate {
94+
return new DnsTemplate($this);
95+
}
96+
97+
/**
98+
* @return Domain
99+
*/
100+
public function domains() : Domain {
101+
return new Domain($this);
102+
}
103+
104+
/**
105+
* @return Reseller
106+
*/
107+
public function resellers() : Reseller {
108+
return new Reseller($this);
109+
}
110+
111+
/**
112+
* @return ResellerPlan
113+
*/
114+
public function resellerPlans() : ResellerPlan {
115+
return new ResellerPlan($this);
116+
}
117+
118+
/**
119+
* @return SSLApprover
120+
*/
121+
public function sslApprovers() : SSLApprover {
122+
return new SSLApprover($this);
123+
}
124+
125+
/**
126+
* @return SSLCertificate
127+
*/
128+
public function sslCertificates() : SSLCertificate {
129+
return new SSLCertificate($this);
130+
}
131+
132+
/**
133+
* @return SSLProduct
134+
*/
135+
public function sslProducts() : SSLProduct {
136+
return new SSLProduct($this);
137+
}
138+
139+
/**
140+
* @return TLD
141+
*/
142+
public function tld() : TLD {
143+
return new TLD($this);
144+
}
145+
146+
/**
147+
* @return Webhosting
148+
*/
149+
public function webhosting() : Webhosting {
150+
return new Webhosting($this);
151+
}
152+
153+
/**
154+
* @return WebhostingPlan
155+
*/
156+
public function webhostingPlans() : WebhostingPlan {
157+
return new WebhostingPlan($this);
158+
}
159+
72160
/**
73161
* @param $request RequestInterface
74162
* @return ResponseInterface
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
use Http\Promise\Promise;
7+
use Psr\Http\Message\RequestInterface;
8+
use Psr\Http\Message\ResponseInterface;
9+
10+
interface ICancelable
11+
{
12+
public function cancel($id, $data = [], $urlPostfix = '') : ResponseInterface;
13+
14+
public function cancelAsync($id, $data = [], $urlPostfix = '') : Promise;
15+
16+
public function cancelRequest($id, $data = [], $urlPostfix = '') : RequestInterface;
17+
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
use Http\Promise\Promise;
7+
use Psr\Http\Message\RequestInterface;
8+
use Psr\Http\Message\ResponseInterface;
9+
10+
interface ICheckable
11+
{
12+
public function check($key, $data = [], $urlPostfix = '') : ResponseInterface;
13+
14+
public function checkAsync($key, $data = [], $urlPostfix = '') : Promise;
15+
16+
public function checkRequest($key, $data = [], $urlPostfix = '') : RequestInterface;
17+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
interface IContact
7+
{
8+
9+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
use Http\Promise\Promise;
7+
use Psr\Http\Message\RequestInterface;
8+
use Psr\Http\Message\ResponseInterface;
9+
10+
interface ICreatable
11+
{
12+
public function create($data = [], $urlPostfix = '') : ResponseInterface;
13+
14+
public function createAsync($data = [], $urlPostfix = '') : Promise;
15+
16+
public function createRequest($data = [], $urlPostfix = '') : RequestInterface;
17+
18+
public function getCreateUrl() : string;
19+
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
namespace BekoDesign\versioAPI\Contracts;
3+
4+
5+
use Http\Promise\Promise;
6+
use Psr\Http\Message\RequestInterface;
7+
use Psr\Http\Message\ResponseInterface;
8+
9+
interface IDeleteable
10+
{
11+
public function delete($id, $data = [], $urlPostfix = '') : ResponseInterface;
12+
13+
public function deleteAsync($id, $data = [], $urlPostfix = '') : Promise;
14+
15+
public function deleteRequest($id, $data = [], $urlPostfix = '') : RequestInterface;
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace BekoDesign\versioAPI\Contracts;
4+
5+
6+
interface IDnsTemplate
7+
{
8+
9+
}

0 commit comments

Comments
 (0)