You are here

class CronKeyChangeCommands in Cron key change 2.x

Same name and namespace in other branches
  1. 8 src/Commands/CronKeyChangeCommands.php \Drupal\cronkeychange\Commands\CronKeyChangeCommands

Drupal 9 commands.

For commands that are parts of modules, Drush expects to find commandfiles in __MODULE__/src/Commands, and the namespace is Drupal/__MODULE__/Commands.

In addition to a commandfile like this one, you need to add a drush.services.yml in root of your module like this module does.

Hierarchy

Expanded class hierarchy of CronKeyChangeCommands

1 string reference to 'CronKeyChangeCommands'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses CronKeyChangeCommands
cronkeychange.command in ./drush.services.yml
Drupal\cronkeychange\Commands\CronKeyChangeCommands

File

src/Commands/CronKeyChangeCommands.php, line 16

Namespace

Drupal\cronkeychange\Commands
View source
class CronKeyChangeCommands extends DrushCommands {

  /**
   * Generate new cron key.
   *
   * @command cronkeychange
   */
  public function cronkeychange() {
    cronkeychange_generate_submit();
    $this
      ->output()
      ->writeln(dt('New cron key generated.'));
  }

}

Members