function DrupalApplication::addDrupalCommands
Same name and namespace in other branches
- main core/lib/Drupal/Core/Command/DrupalApplication.php \Drupal\Core\Command\DrupalApplication::addDrupalCommands()
Discovers commands that are provided by installed modules.
1 call to DrupalApplication::addDrupalCommands()
- DrupalApplication::bootstrap in core/
lib/ Drupal/ Core/ Command/ DrupalApplication.php - Bootstraps Drupal in a way that is appropriate for console commands.
File
-
core/
lib/ Drupal/ Core/ Command/ DrupalApplication.php, line 156
Class
- DrupalApplication
- Customize the Symfony Application for Drupal.
Namespace
Drupal\Core\CommandCode
protected function addDrupalCommands(ContainerInterface $container) : void {
$this->setCommandLoader($container->get('console.command_loader'));
// Add commands that don't use an attribute, relying solely on configure().
if ($container->hasParameter('console.command.ids')) {
foreach ($container->getParameter('console.command.ids') as $id) {
$this->addCommand($container->get($id));
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.