Skip to content

Commit

Permalink
Change naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Shkryob committed Nov 5, 2018
1 parent 74dd86c commit bec0c81
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"autoload": {
"psr-4": {
"Lextira\\PureFTPdClient\\": "src/"
"Lextira\\PureFTPdManager\\": "src/"
}
},
"config": {
Expand All @@ -23,7 +23,7 @@
"extra": {
"laravel": {
"providers": [
"Lextira\\PureFTPdClient\\Providers\\PureFTPdServiceProvider"
"Lextira\\PureFTPdManager\\Providers\\PureFTPdServiceProvider"
]
}
}
Expand Down
28 changes: 14 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## pureftp-client
Laravel client package for <https://github.com/lextira/pureftpd>
## pureftpd-manager
Laravel client package that allows to manage FTP accounts for <https://github.com/lextira/pureftpd>

### Installation

- Run
```
composer require lextira/pureftpd-client
composer require lextira/pureftpd-manager
```
- Set environment variables LEXTIRA_PUREFTPD_HOST and LEXTIRA_PUREFTPD_AUTH_KEY for configuration

Expand All @@ -18,7 +18,7 @@ composer require lextira/pureftpd-client
namespace App\Services\Backend\Providers;
...
use Lextira\PureFTPdClient\Providers\PureFTPdServiceProvider;
use Lextira\PureFTPdManager\Providers\PureFTPdServiceProvider;
/**
* Class BackendServiceProvider
Expand All @@ -43,20 +43,20 @@ class BackendServiceProvider extends ServiceProvider
```

- Inject PureFTPdClient wherever you want
- Inject PureFTPdManager wherever you want

```
<?php
namespace App\Domains\FTP\Jobs;
use Illuminate\Http\Request;
use Lextira\PureFTPdClient\Services\PureFTPdClient;
use Lextira\PureFTPdManager\Services\PureFTPdManager;
use Lucid\Foundation\Job;
class GetAccountsJob extends Job {
public function handle(PureFTPdClient $ftpClient, Request $request)
public function handle(PureFTPdManager $ftpManager, Request $request)
{
return $ftpClient->accounts()->getPage($request->input('page', 1));
return $ftpManager->accounts()->getPage($request->input('page', 1));
}
}
```
Expand All @@ -65,7 +65,7 @@ class GetAccountsJob extends Job {

```
<?php
$ftpClient->accounts()->get($id);
$ftpManager->accounts()->get($id);
/*
stdClass Object
Expand All @@ -86,7 +86,7 @@ stdClass Object
)
*/
$ftpClient->accounts()->getPage($pageNumber);
$ftpManager->accounts()->getPage($pageNumber);
/*
stdClass Object
Expand Down Expand Up @@ -127,7 +127,7 @@ stdClass Object
*/
try {
$ftpClient->accounts()->create([
$ftpManager->accounts()->create([
'login' => 'my_login',
'password' => 'pass',
'relative_dir' => 'dir',
Expand Down Expand Up @@ -165,7 +165,7 @@ stdClass Object
*/
try {
$ftpClient->accounts()->update($id, [
$ftpManager->accounts()->update($id, [
'login' => 'my_login,
'password' => 'pass',
'relative_dir' => 'dir',
Expand Down Expand Up @@ -202,7 +202,7 @@ stdClass Object
)
*/
$ftpClient->domains()->getPage($pageNumber);
$ftpManager->domains()->getPage($pageNumber);
/*
stdClass Object
Expand Down Expand Up @@ -238,7 +238,7 @@ stdClass Object
)
*/
$ftpClient->health()->check();
$ftpManager->health()->check();
/*
stdClass Object
Expand Down
2 changes: 1 addition & 1 deletion src/models/Account.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Lextira\PureFTPdClient\Models;
namespace Lextira\PureFTPdManager\Models;

class Account extends BaseModel {
protected $path = 'accounts';
Expand Down
4 changes: 2 additions & 2 deletions src/models/BaseModel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Lextira\PureFTPdClient\Models;
namespace Lextira\PureFTPdManager\Models;

use GuzzleHttp\Exception\ClientException;
use \Illuminate\Validation\ValidationException;
Expand Down Expand Up @@ -77,7 +77,7 @@ public function update($id, $data)
protected function getHeaders()
{
$headers = [
'User-Agent' => 'Lextira/PureFTPdClient/1.0',
'User-Agent' => 'Lextira/PureFTPdManager/1.0',
'Accept' => 'application/json',
];

Expand Down
2 changes: 1 addition & 1 deletion src/models/Domain.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Lextira\PureFTPdClient\Models;
namespace Lextira\PureFTPdManager\Models;

use http\Exception\BadMethodCallException;

Expand Down
2 changes: 1 addition & 1 deletion src/models/Health.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Lextira\PureFTPdClient\Models;
namespace Lextira\PureFTPdManager\Models;

class Health extends BaseModel {
protected $path = 'health';
Expand Down
2 changes: 1 addition & 1 deletion src/providers/PureFTPdServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Lextira\PureFTPdClient\Providers;
namespace Lextira\PureFTPdManager\Providers;

use Illuminate\Support\ServiceProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
namespace Lextira\PureFTPdClient\Services;
namespace Lextira\PureFTPdManager\Services;

use GuzzleHttp\Client;
use Lextira\PureFTPdClient\Models\Account;
use Lextira\PureFTPdClient\Models\Domain;
use Lextira\PureFTPdClient\Models\Health;
use Lextira\PureFTPdClient\Providers\PureFTPdServiceProvider;
use Lextira\PureFTPdManager\Models\Account;
use Lextira\PureFTPdManager\Models\Domain;
use Lextira\PureFTPdManager\Models\Health;
use Lextira\PureFTPdManager\Providers\PureFTPdServiceProvider;

class PureFTPdClient {
class PureFTPdManager {
protected $client;
protected $authKey;

Expand Down

0 comments on commit bec0c81

Please sign in to comment.