SlideShare una empresa de Scribd logo
1 de 27
Drush.  Why should it be used?
What will be described? 1. Drush. What is this? Common information. 2. What features does Drush have “from the box”? 3. Features which Drush may have with extensions. 4. Examples of how Drush helps during development process.
What won't be described? 1. Aliases of sites. 2. Synchronization of code and databases. 3. Development of extensions. 4. Upgrade of Drupal code, modules and themes. 5. Many other helpful Drush commands and features which I don't know about.
Part 1 Common information.
Common information 1. Drush ==  dru pal  sh ell == command line. 2. Installation of Drush –  README  helps us! 3. What's next? Ask  Drush  to show you what it can to do! 4. So many commands, how could I use them? Ask  Help  for help! 5. How to use commands? It's simple: «drush [options] [command]»
First Drush response Execute a drush command. Run  `drush help [command]`  to view command specific   help.  Run  `drush topic`  to read even more documentation. Global options (see  `drush topic core-global-options`  for the full list):  … options… Core drush commands: (core)  … commands… Field commands: (field)  … commands… SQL commands: (sql)  … commands… User commands: (user)  … commands…
Help message ss81@laptop:~$  drush help cc Clear a specific cache, or all drupal caches. Arguments: type  The particular cache to clear. Omit  this argument to choose from  available caches.  Aliases: cc
Clear cache and enable module ss81@laptop:~$  drush cc all 'all' cache was cleared  [success] ss81@laptop:~$  drush en -y forum The following extensions will be enabled: taxonomy, forum Do you really want to continue? (y/n): y forum was enabled successfully.  [ok] taxonomy was enabled successfully.  [ok]
Part 2 Extend Drush features with other modules.
Groups of commands 1. Core rush commands (28 commands).  2. Field commands (5 commands). 3. Project manager commands (11 commands). 4. SQL commands (6 commands). 5. User commands (9 commands). TOTAL: 59.
Modules, which I like 1. Devel. 2. Drush Make. 3. Module Builder. 4. Drush Cleanup. 5. Backup and Migrate.
Devel All commands in devel: (devel) … devel-reinstall (dre)  Disable, Uninstall, and Install a list of projects.  ... fn-view (fnv)  Show the source of specified function or method. All commands in devel_generate: (devel_generate) generate-content (genc)  Create content.  ...
Drush Make 1. Projects: drupal, pressflow, modules, themes. Could be downloaded from repository, by direct link, by name. 2. Libraries: any files you need to use.
Example of Drush Make file projects[] = drupal projects[] = apachesolr … libraries[SolrPhpClient][download][type] = "get"  libraries[SolrPhpClient][download][url] = "http://solr-php-client.googlecode.com/files/SolrPhpClient.r22.2009-11-09.tgz"  libraries[SolrPhpClient][destination] = "modules/apachesolr"
Module Builder Examples: drush mb my_module menu cron nodeapi drush mb my_module menu cron --write  --name="My module" --dep="forum views" drush mb my_module menu cron --add
Backup and Migrate All commands in backup_migrate: (backup_migrate) bam-backup (bb)  Backup the site's database with Backup and Migrate. bam-backups  Get a list of previously created backup files. bam-destinations  Get a list of available destinations. bam-profiles  Get a list of available settings profiles. bam-restore  Restore the site's database with Backup and Migrate. bam-sources  Get a list of available sources.
Part 3 How Drush helps during development process.
Base facts 1. Site URL is http://example.dev. 2. Version of Drupal – 7. 3. Additional modules: admin_menu, pathauto, views. 4. Custom modules: one module with some features will be created. It will use database. PS: no Drush Make because it's not interesting.
Step 1 ss81@laptop:~/session$  drush dl drupal Project drupal (7.2) downloaded to /home/ss81/session/drupal-7.2.  [success] Project drupal contains:  [success] - 3 profiles: minimal, testing, standard - 4 themes: bartik, seven, garland, stark - 47 modules: drupal_system_listing_compatible_test, ...
Step 2 ss81@laptop:~/session$  mv drupal-7.2/* ./ ss81@laptop:~/session$  mv drupal-7.2/.htaccess ./ ss81@laptop:~/session$  ls authorize.php  cron.php  index.php  install.php  LICENSE.txt  modules  robots.txt  themes  web.config CHANGELOG.txt  drupal-7.2  INSTALL.mysql.txt  … ss81@laptop:~/session$  rm -r drupal-7.2/
Step 3 ss81@laptop:~/session$  drush si --db-url =mysql://root:111@localhost/session  --account-name =ss81  --account-pass =qwerty You are about to create a sites/default/files directory and create  a sites/default/settings.php file and DROP your 'session' database and then CREATE a new one. Do you want to continue? (y/n): y Starting Drupal installation. This takes a few seconds ...  [ok]
Step 4 ss81@laptop:~/session$  drush dl admin_menu views pathauto token … ss81@laptop:~/session$  drush en -y admin_menu views pathauto token The following projects have unmet dependencies: views requires ctools Would you like to download them? (y/n): y Project ctools (7.x-1.0-alpha4) downloaded to /home/ss81/session/sites/all/modules/ctools.  [success] ... That's all. We installed a site! Let's create a custom module.
Step 5 ss81@laptop:~/session$  drush mbdl Hook files have been downloaded to public://hooks and processed. We need to download hooks definitions before we can generate a module. There are 33 files with different hooks, so this could be used as a good manual.
Step 6 ss81@laptop:~/session$  drush mb my_module menu permission user_load  --write   --name ="My module"  --desc ="My test module“ --pachage ="test"  --noi Proposed my_module.module: … code of the module... Proposed my_module.info: … code of the info file...
Helpful commands drush dre -y my_module drush sql-dump > dump.sql drush -y sql-drop drush -y sql-cli < dump.sql drush cc all drush scr test.php
Helpful links http://drupal.org/project/drush http://drush.ws http://groups.drupal.org/drush http://drupal.org/taxonomy/term/4654 http://drush.ws/resources
Questions Email:  sergei@powerfulcms.com Skype: sergei.stryukov Drupal: http://drupal.org/user/228065

Más contenido relacionado

La actualidad más candente

Drush - More Beer, Less Effort
Drush - More Beer, Less EffortDrush - More Beer, Less Effort
Drush - More Beer, Less EffortRuben Teijeiro
 
Drush&drupal. administration
Drush&drupal. administrationDrush&drupal. administration
Drush&drupal. administrationzabej
 
Drush and drupal. администрирование волчек михаил
Drush and drupal. администрирование  волчек михаилDrush and drupal. администрирование  волчек михаил
Drush and drupal. администрирование волчек михаилdrupalconf
 
Contribuir a Drupal - Entorno
Contribuir a Drupal - EntornoContribuir a Drupal - Entorno
Contribuir a Drupal - EntornoKeopx
 
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...Drupaltour
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrupal Camp Delhi
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studiodeWeb
 
How to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentHow to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentAcquia
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesGerald Villorente
 
Beginning Jquery In Drupal Theming
Beginning Jquery In Drupal ThemingBeginning Jquery In Drupal Theming
Beginning Jquery In Drupal ThemingRob Knight
 
ASU DUG - SVN and CVS
ASU DUG - SVN and CVSASU DUG - SVN and CVS
ASU DUG - SVN and CVSJeff Beeman
 
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8Jake Borr
 
PuppetConf 2016: Puppet on Windows – Nicolas Corrarello, Puppet
PuppetConf 2016: Puppet on Windows – Nicolas Corrarello, PuppetPuppetConf 2016: Puppet on Windows – Nicolas Corrarello, Puppet
PuppetConf 2016: Puppet on Windows – Nicolas Corrarello, PuppetPuppet
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineKrimson
 
Drush in the Composer Era
Drush in the Composer EraDrush in the Composer Era
Drush in the Composer EraPantheon
 
Single node hadoop cluster installation
Single node hadoop cluster installation Single node hadoop cluster installation
Single node hadoop cluster installation Mahantesh Angadi
 

La actualidad más candente (20)

Drush - More Beer, Less Effort
Drush - More Beer, Less EffortDrush - More Beer, Less Effort
Drush - More Beer, Less Effort
 
Drush&drupal. administration
Drush&drupal. administrationDrush&drupal. administration
Drush&drupal. administration
 
2011 - DDU - Intro to Drush
2011 - DDU - Intro to Drush2011 - DDU - Intro to Drush
2011 - DDU - Intro to Drush
 
Drush and drupal. администрирование волчек михаил
Drush and drupal. администрирование  волчек михаилDrush and drupal. администрирование  волчек михаил
Drush and drupal. администрирование волчек михаил
 
Contribuir a Drupal - Entorno
Contribuir a Drupal - EntornoContribuir a Drupal - Entorno
Contribuir a Drupal - Entorno
 
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
DrupalTour. Ternopil — Drupal shell or just Drush (Serhii Puchkovskii, Intern...
 
Dcp'14 drush
Dcp'14 drushDcp'14 drush
Dcp'14 drush
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - Sivaji
 
Drupal from scratch
Drupal from scratchDrupal from scratch
Drupal from scratch
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studio
 
How to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentHow to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of Development
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Beginning Jquery In Drupal Theming
Beginning Jquery In Drupal ThemingBeginning Jquery In Drupal Theming
Beginning Jquery In Drupal Theming
 
ASU DUG - SVN and CVS
ASU DUG - SVN and CVSASU DUG - SVN and CVS
ASU DUG - SVN and CVS
 
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
Drupal Console Deep Dive: How to Develop Faster and Smarter on Drupal 8
 
PuppetConf 2016: Puppet on Windows – Nicolas Corrarello, Puppet
PuppetConf 2016: Puppet on Windows – Nicolas Corrarello, PuppetPuppetConf 2016: Puppet on Windows – Nicolas Corrarello, Puppet
PuppetConf 2016: Puppet on Windows – Nicolas Corrarello, Puppet
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev Machine
 
Drush in the Composer Era
Drush in the Composer EraDrush in the Composer Era
Drush in the Composer Era
 
Sun raysetup
Sun raysetupSun raysetup
Sun raysetup
 
Single node hadoop cluster installation
Single node hadoop cluster installation Single node hadoop cluster installation
Single node hadoop cluster installation
 

Destacado

Iod connect september 2011
Iod connect september 2011Iod connect september 2011
Iod connect september 2011IoD Yorkshire
 
Celebrity Gamertags
Celebrity GamertagsCelebrity Gamertags
Celebrity Gamertagscc23ss
 
My Edible Jetpack: Food Trends in the Digital Age
My Edible Jetpack: Food Trends in the Digital AgeMy Edible Jetpack: Food Trends in the Digital Age
My Edible Jetpack: Food Trends in the Digital AgeKaryn Riegel
 

Destacado (6)

Iod connect september 2011
Iod connect september 2011Iod connect september 2011
Iod connect september 2011
 
Pes 2016
Pes 2016Pes 2016
Pes 2016
 
Trigonometricas1
Trigonometricas1Trigonometricas1
Trigonometricas1
 
Screams
ScreamsScreams
Screams
 
Celebrity Gamertags
Celebrity GamertagsCelebrity Gamertags
Celebrity Gamertags
 
My Edible Jetpack: Food Trends in the Digital Age
My Edible Jetpack: Food Trends in the Digital AgeMy Edible Jetpack: Food Trends in the Digital Age
My Edible Jetpack: Food Trends in the Digital Age
 

Similar a Drush. Why should it be used?

Drupal theming training
Drupal theming trainingDrupal theming training
Drupal theming trainingdropsolid
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилPVasili
 
Lightning Fast Drupal Theming (Drupal 7)
Lightning Fast Drupal Theming (Drupal 7)Lightning Fast Drupal Theming (Drupal 7)
Lightning Fast Drupal Theming (Drupal 7)Globe Runner
 
Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Mediacurrent
 
A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013Chris Hales
 
Drush for drupal website builder
Drush for drupal website builderDrush for drupal website builder
Drush for drupal website builderAdolfo Nasol
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-TranslatorDashamir Hoxha
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and AegirIztok Smolic
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupalDay
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build themDick Olsson
 
Drupalcamp 2010 Drush Presntation
Drupalcamp 2010 Drush PresntationDrupalcamp 2010 Drush Presntation
Drupalcamp 2010 Drush Presntationandrewmriley
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practicesSynapseindiappsdevelopment
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentGerald Villorente
 
Automating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyondAutomating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyondNuvole
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowPhilip Norton
 

Similar a Drush. Why should it be used? (20)

Drupal theming training
Drupal theming trainingDrupal theming training
Drupal theming training
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
 
Lightning Fast Drupal Theming (Drupal 7)
Lightning Fast Drupal Theming (Drupal 7)Lightning Fast Drupal Theming (Drupal 7)
Lightning Fast Drupal Theming (Drupal 7)
 
Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.Drush A beginners guide to a advanced tool.
Drush A beginners guide to a advanced tool.
 
A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013
 
Drush for drupal website builder
Drush for drupal website builderDrush for drupal website builder
Drush for drupal website builder
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-Translator
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build them
 
Drupalcamp 2010 Drush Presntation
Drupalcamp 2010 Drush PresntationDrupalcamp 2010 Drush Presntation
Drupalcamp 2010 Drush Presntation
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
 
Recipes for Drupal distributions
Recipes for Drupal distributionsRecipes for Drupal distributions
Recipes for Drupal distributions
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal Deployment
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Automating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyondAutomating Drupal Development: Makefiles, features and beyond
Automating Drupal Development: Makefiles, features and beyond
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To Swallow
 

Drush. Why should it be used?

  • 1. Drush. Why should it be used?
  • 2. What will be described? 1. Drush. What is this? Common information. 2. What features does Drush have “from the box”? 3. Features which Drush may have with extensions. 4. Examples of how Drush helps during development process.
  • 3. What won't be described? 1. Aliases of sites. 2. Synchronization of code and databases. 3. Development of extensions. 4. Upgrade of Drupal code, modules and themes. 5. Many other helpful Drush commands and features which I don't know about.
  • 4. Part 1 Common information.
  • 5. Common information 1. Drush == dru pal sh ell == command line. 2. Installation of Drush – README helps us! 3. What's next? Ask Drush to show you what it can to do! 4. So many commands, how could I use them? Ask Help for help! 5. How to use commands? It's simple: «drush [options] [command]»
  • 6. First Drush response Execute a drush command. Run `drush help [command]` to view command specific help. Run `drush topic` to read even more documentation. Global options (see `drush topic core-global-options` for the full list): … options… Core drush commands: (core) … commands… Field commands: (field) … commands… SQL commands: (sql) … commands… User commands: (user) … commands…
  • 7. Help message ss81@laptop:~$ drush help cc Clear a specific cache, or all drupal caches. Arguments: type The particular cache to clear. Omit this argument to choose from available caches. Aliases: cc
  • 8. Clear cache and enable module ss81@laptop:~$ drush cc all 'all' cache was cleared [success] ss81@laptop:~$ drush en -y forum The following extensions will be enabled: taxonomy, forum Do you really want to continue? (y/n): y forum was enabled successfully. [ok] taxonomy was enabled successfully. [ok]
  • 9. Part 2 Extend Drush features with other modules.
  • 10. Groups of commands 1. Core rush commands (28 commands). 2. Field commands (5 commands). 3. Project manager commands (11 commands). 4. SQL commands (6 commands). 5. User commands (9 commands). TOTAL: 59.
  • 11. Modules, which I like 1. Devel. 2. Drush Make. 3. Module Builder. 4. Drush Cleanup. 5. Backup and Migrate.
  • 12. Devel All commands in devel: (devel) … devel-reinstall (dre) Disable, Uninstall, and Install a list of projects. ... fn-view (fnv) Show the source of specified function or method. All commands in devel_generate: (devel_generate) generate-content (genc) Create content. ...
  • 13. Drush Make 1. Projects: drupal, pressflow, modules, themes. Could be downloaded from repository, by direct link, by name. 2. Libraries: any files you need to use.
  • 14. Example of Drush Make file projects[] = drupal projects[] = apachesolr … libraries[SolrPhpClient][download][type] = &quot;get&quot; libraries[SolrPhpClient][download][url] = &quot;http://solr-php-client.googlecode.com/files/SolrPhpClient.r22.2009-11-09.tgz&quot; libraries[SolrPhpClient][destination] = &quot;modules/apachesolr&quot;
  • 15. Module Builder Examples: drush mb my_module menu cron nodeapi drush mb my_module menu cron --write --name=&quot;My module&quot; --dep=&quot;forum views&quot; drush mb my_module menu cron --add
  • 16. Backup and Migrate All commands in backup_migrate: (backup_migrate) bam-backup (bb) Backup the site's database with Backup and Migrate. bam-backups Get a list of previously created backup files. bam-destinations Get a list of available destinations. bam-profiles Get a list of available settings profiles. bam-restore Restore the site's database with Backup and Migrate. bam-sources Get a list of available sources.
  • 17. Part 3 How Drush helps during development process.
  • 18. Base facts 1. Site URL is http://example.dev. 2. Version of Drupal – 7. 3. Additional modules: admin_menu, pathauto, views. 4. Custom modules: one module with some features will be created. It will use database. PS: no Drush Make because it's not interesting.
  • 19. Step 1 ss81@laptop:~/session$ drush dl drupal Project drupal (7.2) downloaded to /home/ss81/session/drupal-7.2. [success] Project drupal contains: [success] - 3 profiles: minimal, testing, standard - 4 themes: bartik, seven, garland, stark - 47 modules: drupal_system_listing_compatible_test, ...
  • 20. Step 2 ss81@laptop:~/session$ mv drupal-7.2/* ./ ss81@laptop:~/session$ mv drupal-7.2/.htaccess ./ ss81@laptop:~/session$ ls authorize.php cron.php index.php install.php LICENSE.txt modules robots.txt themes web.config CHANGELOG.txt drupal-7.2 INSTALL.mysql.txt … ss81@laptop:~/session$ rm -r drupal-7.2/
  • 21. Step 3 ss81@laptop:~/session$ drush si --db-url =mysql://root:111@localhost/session --account-name =ss81 --account-pass =qwerty You are about to create a sites/default/files directory and create a sites/default/settings.php file and DROP your 'session' database and then CREATE a new one. Do you want to continue? (y/n): y Starting Drupal installation. This takes a few seconds ... [ok]
  • 22. Step 4 ss81@laptop:~/session$ drush dl admin_menu views pathauto token … ss81@laptop:~/session$ drush en -y admin_menu views pathauto token The following projects have unmet dependencies: views requires ctools Would you like to download them? (y/n): y Project ctools (7.x-1.0-alpha4) downloaded to /home/ss81/session/sites/all/modules/ctools. [success] ... That's all. We installed a site! Let's create a custom module.
  • 23. Step 5 ss81@laptop:~/session$ drush mbdl Hook files have been downloaded to public://hooks and processed. We need to download hooks definitions before we can generate a module. There are 33 files with different hooks, so this could be used as a good manual.
  • 24. Step 6 ss81@laptop:~/session$ drush mb my_module menu permission user_load --write --name =&quot;My module&quot; --desc =&quot;My test module“ --pachage =&quot;test&quot; --noi Proposed my_module.module: … code of the module... Proposed my_module.info: … code of the info file...
  • 25. Helpful commands drush dre -y my_module drush sql-dump > dump.sql drush -y sql-drop drush -y sql-cli < dump.sql drush cc all drush scr test.php
  • 26. Helpful links http://drupal.org/project/drush http://drush.ws http://groups.drupal.org/drush http://drupal.org/taxonomy/term/4654 http://drush.ws/resources
  • 27. Questions Email: sergei@powerfulcms.com Skype: sergei.stryukov Drupal: http://drupal.org/user/228065