100 likes | 232 Vues
Drush, short for Drupal Shell, is a command-line utility that enables developers to interact with Drupal installations efficiently. It allows you to execute numerous tasks directly from the command prompt, such as managing databases, performing site upgrades, and handling user roles. By incorporating various configuration files like drushrc.php and aliases.drushrc.php, users can customize Drush to fit their workflow. With the potential to extend through contributed modules, Drush enhances the development experience, making it indispensable for any Drupal developer.
E N D
Drush: The Drupal Shell Utility Trevor Mckeown Founder & Owner Sublime Technologies trevor@sublimetechnologies.net
What is Drush? • What is Drush? Drush Stands for Drupal Shell • What is a shell? Not something found at the sea. Also interchangeable with the term command prompt • It’s a way to interact with Drupal via the command prompt
Running Scripts via the Command Prompt • Drush is just a php script that you run on the command prompt • Many languages you can run on the command prompt • Examples: Ruby, php, perl, python, and of course bash it’s self • Small Demo
Drush Installation • Download Drush • Place it somewhere you will remember • Symbolic link drush to an path in your $PATH variable • Change directory into a drupal base directory • If settings.php is in sites/defaults directory your all set otherwise use the –l and –r options
Drush Configuration Files • See examples directory under the root drush directory • drushrc.php file for setting common options like -l or -r or many more options. See example.drushrc.php • aliases.drushrc.php or similar file for setting up aliases like @prod @dev @staging. See example.aliases.drushrc.php
Drushconfiguration files continued … • drush.ini for over riding php.ini • An example.bashrc file • Something about sandwiches • A sample command for writing your own commands
What can Drush do from me? • A lot .. • Scripting out deployments including rsync • Database management • Backing up the site and database • User management: add, block, and assign roles to users • Site management: clear cache, run cron, run database updates, install drupal (D7)
What can Drush do for me? • Many modules extend Drush and add additional commands • Features • Views • Devel • Drush Make • Node Export • Many more!
Thank You! Comments, Questions, Concerns Trevor Mckeown trevor@sublimetechnologies.net