Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.1.1
-
Fix Version/s: 4.2.0
-
Component/s: Drupal Integration Modules
-
Labels:
Description
The Drush integration does not follow recent Drush best practices - the attached patch makes the following changes:
- Use standardized command callback names.
- Move validation logic to dedicated validate hooks.
- Switched the cache clearing to use the built in Drush cache clear (cc) command (now is "drush cc civicrm").
- Use drush_log in place of drush_print for log messages (basically drush_print is only for "data output" or output directly associated with interactive prompts).
- Use drush_set_error in place of drush_die for errors - passing the command return value back via callback returns and adding error key strings (used to identify and react to errors in automated systems such as Aegir).
- Added aliases for a few commands (feedback welcome on which commands are commonly used, and if the aliases grok).
- Fixed a few inconsistencies, and added TODOs for some potential other things we could look at improving.
I have tested a few of the commands on a local install, but this could probably use some more exhaustive testing before it is committed (I didn't test install/upgrade commands, and I didn't test what happens with older Drush and CiviCRM versions).