Upcoming SlideShare
Loading in...5




A "quick" introduction to drush, the Drupal command line tool.

A "quick" introduction to drush, the Drupal command line tool.



Total Views
Views on SlideShare
Embed Views



1 Embed 1

https://duckduckgo.com 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Drush Drush Presentation Transcript

  • drusha "quick" introduction
  • What is it?The Drupal shellAllows interaction with a Drupal site viacommand lineEasy to useReally useful (honest!)
  • InstallingLinux/OSX pear channel-discover pear.drush.org pear install drush/drushMay have to run with sudoMight also have to run pear upgrade-allCan also use apt-get (might not be up to date)
  • InstallingWindowsInstaller Availablewww.drush.org/drush_windows_installerUsed to be almost unusable but appears to bebetter.
  • Using Drush
  • drushPrints a list of available drush commandsGood to see if you have installed it or not
  • drush help <command>Prints out help text for a command.
  • drush statusShows current status of a drupal siteOr just the version of drush if no site is found
  • drush pm-listList currently installed modules and themesUse --status to filter the list by status.Example:drush pm-list --status=enabled
  • drush pm-download <project>Downloads projects from Drupal.orgIncludes projects, themes and even DrupalitselfUse the --select to prompt for a certain releaseCan be shortened to "drush dl"
  • drush pm-releases <project>List the releases for a projectHelpful when using pm-download
  • drush site-install <profile>Install a site from the command line.--account-name to set master user username--account-pass to set master user password--db-url to set database connection stringExample:drush site-install minimal --account-name=admin --account-pass=admin --db-url=mysql://root:QWEqwe123@localhost/drupal7
  • drush pm-enable <extension>Enable a module or theme.Use --yes to assume "yes" to promptsCan be shortened to "drush en <extension>"
  • Live Demo!Full site install from the command line
  • drush pm-disable <extension>Disable a module or theme.Can be shortened to "drush dis <extension>"
  • drush pm-uninstall <extension>Completely remove a module from DrupalBasically runs the uninstall hooks
  • drush pm-updatecode <project>Update the code of an projectUse --security-only to only get security releasesUpdates the code only, use "drush updatedb"to also apply any database updates
  • drush pm-update <project>Updates a projects code and applies anydatabase updatesSame as running pm-updatecode andupdatedb
  • drush cache-clear allClear all cachesCan use shortcut "drush cc all"Specify type of cache to clear or leave blank toprompt for one
  • drush core-cronRun the cronCan also use "drush cron"
  • Interacting with searchdrush search-indexdrush search-reindexdrush search-statusNote: Need to have search module enabled!
  • Interacting with usersdrush user-block usernamedrush user-unblock usernamedrush user-password username --password=passworddrush user-information username
  • Interacting with the databasedrush sql-dropdrush sql-dump --result-file=../mysite.sqldrush sql-query --file=../mysite.sql
  • ...and many moreBarely scratched the surface here*Lots* more commands and flags availableFor a full list see:http://www.drush.org/help/5
  • Drush Make
  • Drush MakeSort of like install profilesSingle subject in itselfUses a make file to download all neededmodulesMakes version control easier
  • drush make-generate <makefile>Generate a make file from an existing DrupalinstallNo need to know the make file syntax insideand outExample:drush make-generate mysite.make
  • Example Make File; This file was auto-generated by drush makecore = 7.xapi = 2projects[drupal][version] = "7.x"; Modulesprojects[ctools][version] = "1.0"projects[devel][version] = "1.2"projects[google_analytics][version] = "1.2"projects[views][version] = "3.3"
  • drush make <makefile>Make a drush site using a make fileExample:drush make mysite.make
  • MOAR!!!I can haz moar commands?
  • Drush APIDrush has an API and so modules can plug into drush and allow additional commandsReference site:http://api.drush.org/api/drush
  • ViewsInteract with views from Drushdrush views-listdrush views-enable <view>drush views-disable <view>
  • Devel GenerateAdds devel generate support for drushCreate 10 nodes:drush generate-content 10Create 10 nodes, with 5 (or less) comments:drush generate-content 10 5(Make sure comment is enabled!)
  • ResourcesDrush Project Pagewww.drupal.org/project/drushMain Drush Sitewww.drush.orgDrush APIapi.drush.org/api/drush