class SanityCheckCommand in MongoDB 8.2
Class SanityCheckCommand provides the mongodb:watchdog:sanitycheck command.
@DrupalCommand ( extension="mongodb_watchdog", extensionType="module" )
Hierarchy
- class \Drupal\mongodb_watchdog\Command\SanityCheckCommand extends \Drupal\Console\Core\Command\ContainerAwareCommand
Expanded class hierarchy of SanityCheckCommand
1 string reference to 'SanityCheckCommand'
- console.services.yml in modules/
mongodb_watchdog/ console.services.yml - modules/mongodb_watchdog/console.services.yml
1 service uses SanityCheckCommand
- mongodb_watchdog.command.sanitycheck in modules/
mongodb_watchdog/ console.services.yml - Drupal\mongodb_watchdog\Command\SanityCheckCommand
File
- modules/
mongodb_watchdog/ src/ Command/ SanityCheckCommand.php, line 23
Namespace
Drupal\mongodb_watchdog\CommandView source
class SanityCheckCommand extends ContainerAwareCommand {
/**
* The mongodb.watchdog.sanity_check service.
*
* @var \Drupal\mongodb_watchdog\Install\SanityCheck
*/
protected $sanityCheck;
/**
* The serialisation.yaml service.
*
* @var \Drupal\Component\Serialization\Yaml
*/
protected $yaml;
/**
* SanityCheckCommand constructor.
*
* @param \Drupal\mongodb_watchdog\Install\Sanitycheck $sanityCheck
* The mongodb.watchdog.sanity_check service.
* @param \Drupal\Component\Serialization\Yaml $yaml
* The serialization.yaml service.
*/
public function __construct(Sanitycheck $sanityCheck, Yaml $yaml) {
parent::__construct();
$this->sanityCheck = $sanityCheck;
$this->yaml = $yaml;
}
/**
* {@inheritdoc}
*/
protected function configure() : void {
$this
->setName('mongodb:watchdog:sanitycheck')
->setDescription($this
->trans('commands.mongodb.watchdog.sanitycheck.description'))
->setHelp($this
->trans('commands.mongodb.watchdog.sanitycheck.help'))
->setAliases([
'mdbwsc',
'mowd-sc',
]);
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) : void {
$buckets = $this->sanityCheck
->buildCollectionstats();
$this
->getIo()
->writeln($this->yaml
->encode($buckets));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SanityCheckCommand:: |
protected | property | The mongodb.watchdog.sanity_check service. | |
SanityCheckCommand:: |
protected | property | The serialisation.yaml service. | |
SanityCheckCommand:: |
protected | function | ||
SanityCheckCommand:: |
protected | function | ||
SanityCheckCommand:: |
public | function | SanityCheckCommand constructor. |