Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/services/drupal-console/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ services:
arguments: ['@database', '@date.formatter', '@entity_type.manager', '@string_translation']
tags:
- { name: drupal.command }
console.database_log_poll:
class: Drupal\Console\Command\Database\LogPollCommand
arguments: ['@database', '@date.formatter', '@entity_type.manager', '@string_translation']
tags:
- { name: drupal.command }
console.database_restore:
class: Drupal\Console\Command\Database\RestoreCommand
arguments: ['@app.root']
Expand Down
43 changes: 21 additions & 22 deletions src/Command/Database/LogPollCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,28 @@
class LogPollCommand extends DatabaseLogBase
{
/**
* @var
*/
* @var
*/
protected $duration;

/**
*
*/
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new DrupalStyle($input, $output);

$io->note($this->trans('commands.database.log.poll.messages.warning'));

$this->getDefaultOptions($input);
$this->duration = $input->getArgument('duration');

$this->pollForEvents($io);
}

/**
* {@inheritdoc}
*/
protected function configure()
{
$this
Expand All @@ -39,24 +54,8 @@ protected function configure()
}

/**
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new DrupalStyle($input, $output);

$io->note($this->trans('commands.database.log.poll.messages.warning'));

$this->getDefaultOptions($input);
$this->duration = $input->getArgument('duration');

$this->pollForEvents($io);
}

/**
* @param \Drupal\Console\Core\Style\DrupalStyle $io
*/
* @param DrupalStyle $io
*/
protected function pollForEvents(DrupalStyle $io)
{
$query = $this->makeQuery($io)->countQuery();
Expand Down