class CronKeyChangeCommands in Cron key change 8
Same name and namespace in other branches
- 2.x 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
- class \Drupal\cronkeychange\Commands\CronKeyChangeCommands extends \Drush\Commands\DrushCommands
Expanded class hierarchy of CronKeyChangeCommands
1 string reference to 'CronKeyChangeCommands'
1 service uses CronKeyChangeCommands
File
- src/
Commands/ CronKeyChangeCommands.php, line 16
Namespace
Drupal\cronkeychange\CommandsView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CronKeyChangeCommands:: |
public | function | Generate new cron key. |