Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Sep 17, 2017
1 parent 78c2837 commit b0f52fe
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 47 deletions.
31 changes: 1 addition & 30 deletions README.md
Expand Up @@ -28,40 +28,11 @@ Going your project directory on shell and run this command:
$ composer require tabuna/vesta-api
```

Add to `config/app.php`:

Service provider to the 'providers' array:

```php
'providers' => [
// Laravel Framework Service Providers...
//...

// Package Service Providers
Tabuna\VestaAPI\Providers\VestaServiceProvider::class

// ...

// Application Service Providers
// ...
];
```

Facades aliases to the 'aliases' array:
```php
'aliases' => [
// ...

'Vesta' => Tabuna\VestaAPI\Facades\Vesta::class,
];
```

Publication
```php
php artisan vendor:publish
php artisan vendor:publish -all
```


Generate api key

```bash
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Expand Up @@ -26,19 +26,19 @@
],
"autoload": {
"psr-4": {
"VestaAPI\\": "src/"
"Tabuna\\": "src/Vesta"
}
},
"extra": {
"laravel": {
"providers": [
"Tabuna\\VestaAPI\\Providers\\VestaServiceProvider"
"Tabuna\\Vesta\\Providers\\VestaServiceProvider"
],
"aliases": {
"Dashboard": "Tabuna\\VestaAPI\\Facades\\Vesta"
"Dashboard": "Tabuna\\Vesta\\Facades\\Vesta"
}
}
},
"minimum-stability": "alpha",
"minimum-stability": "stable",
"prefer-stable": true
}
2 changes: 2 additions & 0 deletions config/vesta.php
Expand Up @@ -7,13 +7,15 @@
| Default Remote Server Name
|--------------------------------------------------------------------------
*/

'default' => 'testVDS',

/*
|--------------------------------------------------------------------------
| Remote Server
|--------------------------------------------------------------------------
*/

'servers' => [
'testVDS' => [
'host' => '0.0.0.0',
Expand Down
2 changes: 1 addition & 1 deletion scr/Exceptions/VestaExceptions.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Exceptions;
namespace Tabuna\Vesta\Exceptions;

use Exception;

Expand Down
4 changes: 2 additions & 2 deletions scr/Facades/Vesta.php
@@ -1,9 +1,9 @@
<?php

namespace Tabuna\VestaAPI\Facades;
namespace Tabuna\Vesta\Facades;

use Illuminate\Support\Facades\Facade;
use Tabuna\VestaAPI\Services\VestaAPI;
use Tabuna\Vesta\Services\VestaAPI;

class Vesta extends Facade
{
Expand Down
2 changes: 1 addition & 1 deletion scr/Providers/VestaServiceProvider.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Providers;
namespace Tabuna\Vesta\Providers;

use Illuminate\Support\ServiceProvider;

Expand Down
2 changes: 1 addition & 1 deletion scr/Services/BD.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

trait BD
{
Expand Down
2 changes: 1 addition & 1 deletion scr/Services/Cron.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

trait Cron
{
Expand Down
2 changes: 1 addition & 1 deletion scr/Services/DNS.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

trait DNS
{
Expand Down
2 changes: 1 addition & 1 deletion scr/Services/FileSystem.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

trait FileSystem
{
Expand Down
2 changes: 1 addition & 1 deletion scr/Services/Service.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

trait Service
{
Expand Down
2 changes: 1 addition & 1 deletion scr/Services/User.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

trait User
{
Expand Down
7 changes: 5 additions & 2 deletions scr/Services/VestaAPI.php
@@ -1,9 +1,9 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

use GuzzleHttp\Client;
use Tabuna\VestaAPI\Exceptions\VestaExceptions;
use Tabuna\Vesta\Exceptions\VestaExceptions;

class VestaAPI
{
Expand Down Expand Up @@ -44,12 +44,15 @@ public function server($server = '')
throw new \Exception('Server is not specified');
}
$allServers = config('vesta.servers');

if (!isset($allServers[$server])) {
throw new \Exception('Specified server not found in config');
}

if ($this->keysCheck($server, $allServers)) {
throw new \Exception('Specified server config does not contain host or key');
}

$this->key = (string) $allServers[$server]['key'];
$this->host = (string) $allServers[$server]['host'];

Expand Down
2 changes: 1 addition & 1 deletion scr/Services/Web.php
@@ -1,6 +1,6 @@
<?php

namespace Tabuna\VestaAPI\Services;
namespace Tabuna\Vesta\Services;

trait Web
{
Expand Down

0 comments on commit b0f52fe

Please sign in to comment.