Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-9986

Update and improve Drush integration

    Details

      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).

        Attachments

          Activity

            People

            • Assignee:
              mlutfy Mathieu Lutfy
              Reporter:
              grugnog Owen Barton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: