drush to simplify drupalers work - sivaji

17
Drush to simplify Drupalers work Sivaji J.G, KnackForge Soft Solutions Pvt. Ltd.

Upload: drupal-camp-delhi

Post on 17-May-2015

1.898 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Drush to simplify Drupalers work - Sivaji

Drush to

simplify

Drupalers workSivaji J.G,

KnackForge Soft Solutions Pvt. Ltd.

Page 2: Drush to simplify Drupalers work - Sivaji

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

Page 3: Drush to simplify Drupalers work - Sivaji

Agenda

• What is Drush?

• Requirements and Installation

• How it works?

• Drush commands

Page 4: Drush to simplify Drupalers work - Sivaji

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

Page 5: Drush to simplify Drupalers work - Sivaji

Requirements and Installation

• From PEARo https://github.com/drush-ops/drush#install---pear

• Manual Installationo https://github.com/drush-ops/drush#install---manual

Page 6: Drush to simplify Drupalers work - Sivaji

How it works

Page 7: Drush to simplify Drupalers work - Sivaji

Drush Commands

• pm-download

• site-install

• user-password

• variable-get / set

• cache-clear

• core-cron

• core-status

• php-script

• updatedb

• watchdog-show

• pm-list

• pm-enable

• pm-disable

• pm-uninstall

• sql-drop

• sql-query

• sql-sync

• sql-connect

Page 8: Drush to simplify Drupalers work - Sivaji

$ 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

and bzr)

Page 9: Drush to simplify Drupalers work - Sivaji

$ drush pm-download (dl)

Usage

$ drush dl

Project drupal (7.23) downloaded to

/home/sivaji/Public/drupal-7.23. [success]

Project drupal contains: [success]

- 3 profiles: standard, testing, minimal

- 4 themes: bartik, garland, stark, seven

- 47 modules: image, openid, simpletest,...

Page 10: Drush to simplify Drupalers work - Sivaji

$ drush pm-download (dl)

$ drush dl views

Project views (7.x-3.7) downloaded to

/home/sivaji/Public/drupal-7.23/sites/all/modules/views.

[success]

$ drush dl zen

$ drush dl features-7.x-2.x-dev

Page 11: Drush to simplify Drupalers work - Sivaji

$ drush site-install (si)

Installs Drupal with specified install profile

Usage

• $ drush si standard --site-name="Drush

Test"

• --db-url=<mysql://root:[email protected]/db

• More default values o --account-mail, --account-name, --db-prefix, --locale,

--site-mail, [form name].[parameter name]

Page 12: Drush to simplify Drupalers work - Sivaji

$ drush site-install (si)

$ drush si standard --site-name="Drupal Camp" --db-

url=mysql://[email protected]/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

Page 13: Drush to simplify Drupalers work - Sivaji

$ 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!@#

Page 14: Drush to simplify Drupalers work - Sivaji

$ 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"

Page 15: Drush to simplify Drupalers work - Sivaji

$ drush cache-clear (cc)

Clear a specific cache, or all drupal caches

Usage,

$ drush cc all

$ drush cc menu

Page 16: Drush to simplify Drupalers work - Sivaji

$ 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

Page 17: Drush to simplify Drupalers work - Sivaji

More slides to come