You are here

public function WebformCliService::drush_webform_generate_commands in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Commands/WebformCliService.php \Drupal\webform\Commands\WebformCliService::drush_webform_generate_commands()

Implements drush_hook_COMMAND().

Overrides WebformCliServiceInterface::drush_webform_generate_commands

File

src/Commands/WebformCliService.php, line 1260

Class

WebformCliService
Drush version agnostic commands.

Namespace

Drupal\webform\Commands

Code

public function drush_webform_generate_commands() {

  // Drush 8.x.
  $commands = $this
    ->drush_webform_generate_commands_drush8();
  $filepath = DRUPAL_ROOT . '/' . drupal_get_path('module', 'webform') . '/drush/webform.drush.inc';
  file_put_contents($filepath, $commands);
  $this
    ->drush_print("{$filepath} updated.");

  // Drush 9.x.
  $commands = $this
    ->drush_webform_generate_commands_drush9();
  $filepath = DRUPAL_ROOT . '/' . drupal_get_path('module', 'webform') . '/src/Commands/WebformCommands.php';
  file_put_contents($filepath, $commands);
  $this
    ->drush_print("{$filepath} updated.");
}