-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip * wip * Apply fixes from StyleCI (#76)
- Loading branch information
1 parent
51e0201
commit 30623f9
Showing
5 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Laravel\VaporCli\Commands; | ||
|
||
use Laravel\VaporCli\Helpers; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class DatabaseDeleteProxyCommand extends Command | ||
{ | ||
/** | ||
* Configure the command options. | ||
* | ||
* @return void | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('database:delete-proxy') | ||
->addArgument('database', InputArgument::REQUIRED, 'The name of the database') | ||
->setDescription('Delete the proxy associated to the database.'); | ||
} | ||
|
||
/** | ||
* Execute the command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
Helpers::ensure_api_token_is_available(); | ||
|
||
$databases = $this->vapor->databases(); | ||
|
||
if (!is_numeric($databaseId = $this->argument('database'))) { | ||
$databaseId = $this->findIdByName($databases, $databaseId); | ||
} | ||
|
||
if (is_null($databaseId)) { | ||
Helpers::abort('Unable to find a database with that name / ID.'); | ||
} | ||
|
||
$response = $this->vapor->deleteDatabaseProxy( | ||
$databaseId | ||
); | ||
|
||
Helpers::info('Database proxy deleted successfully.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Laravel\VaporCli\Commands; | ||
|
||
use Laravel\VaporCli\Helpers; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class DatabaseProxyCommand extends Command | ||
{ | ||
/** | ||
* Configure the command options. | ||
* | ||
* @return void | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('database:proxy') | ||
->addArgument('database', InputArgument::REQUIRED, 'The name of the database') | ||
->setDescription('Create an proxy for a database'); | ||
} | ||
|
||
/** | ||
* Execute the command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
Helpers::ensure_api_token_is_available(); | ||
|
||
$databases = $this->vapor->databases(); | ||
|
||
if (!is_numeric($databaseId = $this->argument('database'))) { | ||
$databaseId = $this->findIdByName($databases, $databaseId); | ||
} | ||
|
||
if (is_null($databaseId)) { | ||
Helpers::abort('Unable to find a database with that name / ID.'); | ||
} | ||
|
||
$response = $this->vapor->createDatabaseProxy( | ||
$databaseId | ||
); | ||
|
||
Helpers::info('Database proxy created successfully.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters