use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\ProcessBuilder;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
+use Drupal\Console\Core\Command\Command;
use Drupal\Console\Command\Shared\ConnectTrait;
-use Drupal\Console\Core\Style\DrupalStyle;
class ClientCommand extends Command
{
use ConnectTrait;
- use CommandTrait;
/**
* {@inheritdoc}
$this->trans('commands.database.client.arguments.database'),
'default'
)
- ->setHelp($this->trans('commands.database.client.help'));
+ ->setHelp($this->trans('commands.database.client.help'))
+ ->setAliases(['dbc']);
}
/**
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
-
$database = $input->getArgument('database');
$learning = $input->getOption('learning');
- $databaseConnection = $this->resolveConnection($io, $database);
+ $databaseConnection = $this->resolveConnection($database);
$connection = sprintf(
'%s -A --database=%s --user=%s --password=%s --host=%s --port=%s',
);
if ($learning) {
- $io->commentBlock(
+ $this->getIo()->commentBlock(
sprintf(
$this->trans('commands.database.client.messages.connection'),
$connection