Skip to content

Commit 3b874f2

Browse files
committed
#12 : Remove useless code
1 parent f4bc6e2 commit 3b874f2

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

Diff for: src/Platform/Console/Command/Environment/Database/DumpCommand.php

-22
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
namespace Kiboko\Cloud\Platform\Console\Command\Environment\Database;
66

7-
use Deployer\Console\Application;
8-
use Deployer\Deployer;
97
use Deployer\Host\Host;
10-
use Deployer\Logger\Handler\FileHandler;
11-
use Deployer\Logger\Handler\NullHandler;
12-
use Deployer\Logger\Logger;
138
use Kiboko\Cloud\Domain\Environment\DTO\Context as EnvironmentContext;
149
use Kiboko\Cloud\Domain\Stack\DTO\Context as StackContext;
1510
use Kiboko\Cloud\Platform\Console\EnvironmentWizard;
@@ -100,18 +95,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
10095
return 1;
10196
}
10297

103-
$application = new Application($this->console->getName());
104-
$deployer = new Deployer($application);
105-
$deployer['output'] = $output;
106-
$deployer['log_handler'] = function ($deployer) {
107-
return !empty($deployer->config['log_file'])
108-
? new FileHandler($deployer->config['log_file'])
109-
: new NullHandler();
110-
};
111-
$deployer['logger'] = function ($deployer) {
112-
return new Logger($deployer['log_handler']);
113-
};
114-
11598
$host = new Host($environementContext->deployment->server->hostname);
11699
$host->port($environementContext->deployment->server->port);
117100
$host->user($environementContext->deployment->server->username);
@@ -160,11 +143,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
160143
$process2 = new Process(['ssh', '-t', $host->getUser().'@'.$host->getHostname(), 'docker', 'exec', $containerIds, '/usr/bin/mysqldump', '-u', $username, '--password='.$password, $databaseName, '>', $dumpPath]);
161144
try {
162145
$process2->mustRun();
163-
if (!file_exists($host->getUser().'@'.$host->getHostname().':'.$dumpPath)) {
164-
$format->error('Dump couldn\'t be created');
165-
166-
return 1;
167-
}
168146
$format->success('Dump well created at '.$host->getUser().'@'.$host->getHostname().':'.$dumpPath);
169147

170148
return 0;

0 commit comments

Comments
 (0)