2. About Speaker
•
•
•
•
•
•
•
•
Started Drupal evangelism as trainee in 2008
Integrated Drupal and gnokii for accessing bus routes
information via SMS
GSoC Alumnus 2009
Co-maintainer of quiz module
Contributor to Drupal Core and Contrib modules in drupal.org
Technical reviewer of Drupal books
Featured Speaker / Trainer of Drupal Chennai workshops
Technical Director / Drupal project manager at KnackForge
4. What is Drush?
•
•
•
•
•
•
Command line utility to administer Drupal sites
Typically used as “drush [options] <command>
[argument1] [argument2]”
Commonly used for cache clear, managing modules /
themes / features, cron, etc.
Supports Drupal 6.x and above
Works best on Unix like OS and partially supported
for Windows
Maintained in GitHub /drush-ops/drush
5. Requirements and Installation
•
•
From PEAR
o
https://github.com/drush-ops/drush#install---pear
Manual Installation
o
https://github.com/drush-ops/drush#install---manual
8. $ drush pm-download (dl)
•
•
•
•
•
•
Download any projects from drupal.org
Project could Drupal core, modules, themes or
profiles.
Handles project dependency
Sticks to recommended versions by default
Automatically figure out which project version you
want based
Integrates with version control system (git, svn
11. $ drush site-install (si)
Installs Drupal with specified install profile
Usage
$ drush si standard --site-name="Drush
Test"
--db-url=<mysql://root:pass@127.0.0.1/db
More default values
•
•
•
o
--account-mail, --account-name, --db-prefix, --locale,
--site-mail, [form name].[parameter name]
12. $ drush site-install (si)
$ drush si standard --site-name="Drupal Camp" --dburl=mysql://root@127.0.0.1/learning_drush
You are about to create a sites/default/files directory and create a
sites/default/settings.php file and CREATE the 'learning_drush' database.
Do you want to continue? (y/n): y
Starting Drupal installation. This takes a few seconds ...
[ok]
Installation complete. User name: admin User password: AGn744iDVd
13. $ drush user-password (upwd)
(Re)Set the password for the user account with the
specified name
Usage:
Changing the auto generated password AGn744iDVd to
Admin!@# for admin user.
$ drush upwd admin --password=Admin!@#
14. $ drush variable-get / variable-set
(vget/vset)
Get a list of some or all site variables and
values.
Usage
$ drush variable-get site_name
site_name: "Drupal Camp"
$ drush variable-set site_name "Drupal Camp
Delhi"
15. $ drush cache-clear (cc)
Clear a specific cache, or all drupal caches
Usage,
$ drush cc all
$ drush cc menu
16. $ drush cache-clear (cc)
$ drush cc
Enter a number to choose which cache to clear.
[0] : Cancel
[1] : all
[2] : drush
[3] : theme-registry
[4] : menu
[5] : css-js
[6] : block
[7] : module-list
[8] : theme-list
[9] : registry
[10] : token
[11] : views