function drush_create_commands_from_command_instance

master preflight.inc drush_create_commands_from_command_instance($container, $commandInstance, $includeAllPublicMethods = true)
1 call to drush_create_commands_from_command_instance()

File

includes/preflight.inc, line 400
Preflight, postflight and shutdown code.

Code

function drush_create_commands_from_command_instance($container, $commandInstance, $includeAllPublicMethods = true) {
  $application = $container->get('application');
  $commandFactory = $container->get('commandFactory');
  $commandFactory->setIncludeAllPublicMethods(false);
  $commandList = $commandFactory->createCommandsFromClass($commandInstance, $includeAllPublicMethods);
  foreach ($commandList as $command) {
    drush_add_command_to_application($container, $command);
  }
}