Last active
February 15, 2020 14:52
-
-
Save smhnaji/cd64ba65b6c711d6f2bb072d9fb9b310 to your computer and use it in GitHub Desktop.
Simplest Drupal 7 drush command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This file is belonged to a module called x. | |
// It's all devoted to the drush commands related to the module. | |
/** | |
* Define the drush commands' interface | |
*/ | |
function x_drush_command() | |
{ | |
$items['great-action'] = [ | |
'description' => 'Description of the new perfect command!', | |
]; | |
return $items; | |
} | |
/* | |
* Implement the great-action logic | |
*/ | |
function drush_x_great_action() | |
{ | |
drupal_set_message(t('Hello World from the newly defined perfect action!')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After adding the file, you should...
And we expect the output: