SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Drush.
Why should it be used?
Gold Sponsor of
DrupalCamp Kyiv 2011
Silver Sponsors of
DrupalCamp Kyiv 2011
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 == drupal shell == 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

Contenu connexe

Tendances

Speed up Drupal development with Drush
Speed up Drupal development with DrushSpeed up Drupal development with Drush
Speed up Drupal development with Drush
kbasarab
 
Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode cluster
sushantbit04
 
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
Nuvole
 

Tendances (20)

Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Drush
DrushDrush
Drush
 
Drush in the Composer Era
Drush in the Composer EraDrush in the Composer Era
Drush in the Composer Era
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studio
 
Run wordcount job (hadoop)
Run wordcount job (hadoop)Run wordcount job (hadoop)
Run wordcount job (hadoop)
 
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonDrush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Travis Carden/Drupal Nebraks: Drush Presentation
Travis Carden/Drupal Nebraks: Drush PresentationTravis Carden/Drupal Nebraks: Drush Presentation
Travis Carden/Drupal Nebraks: Drush Presentation
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
 
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto GarcíaOpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and Drush
 
Beginning Jquery In Drupal Theming
Beginning Jquery In Drupal ThemingBeginning Jquery In Drupal Theming
Beginning Jquery In Drupal Theming
 
Speed up Drupal development with Drush
Speed up Drupal development with DrushSpeed up Drupal development with Drush
Speed up Drupal development with Drush
 
Monitoring multiple ultra esb instances with u console
Monitoring multiple ultra esb instances with u consoleMonitoring multiple ultra esb instances with u console
Monitoring multiple ultra esb instances with u console
 
Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode cluster
 
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
 
Drupal Now! - Introduction to Drupal
Drupal Now! - Introduction to DrupalDrupal Now! - Introduction to Drupal
Drupal Now! - Introduction to Drupal
 
Mysql all
Mysql allMysql all
Mysql all
 
Introduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John HixsonIntroduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John Hixson
 
A brief introduction to PostgreSQL
A brief introduction to PostgreSQLA brief introduction to PostgreSQL
A brief introduction to PostgreSQL
 

Similaire à Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011

Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
PVasili
 
Drupal theming training
Drupal theming trainingDrupal theming training
Drupal theming training
dropsolid
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - Sivaji
Drupal Camp Delhi
 

Similaire à Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011 (20)

Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
 
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.
 
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
 
Lightning Fast Drupal Theming (Drupal 7)
Lightning Fast Drupal Theming (Drupal 7)Lightning Fast Drupal Theming (Drupal 7)
Lightning Fast Drupal Theming (Drupal 7)
 
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
 
A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal Deployment
 
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
 
Recipes for Drupal distributions
Recipes for Drupal distributionsRecipes for Drupal distributions
Recipes for Drupal distributions
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-Translator
 
Drupal theming training
Drupal theming trainingDrupal theming training
Drupal theming training
 
Drush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - SivajiDrush to simplify Drupalers work - Sivaji
Drush to simplify Drupalers work - Sivaji
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
 
Exploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molinaExploring composer in drupal 8 with drupal project - salva molina
Exploring composer in drupal 8 with drupal project - salva molina
 
Rapid site production with Drupal
Rapid site production with DrupalRapid site production with Drupal
Rapid site production with Drupal
 
drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010drush_multi @ DrupalDevDays 2010
drush_multi @ DrupalDevDays 2010
 
55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build them
 

Plus de camp_drupal_ua

Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...
camp_drupal_ua
 
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
camp_drupal_ua
 
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
camp_drupal_ua
 
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
camp_drupal_ua
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
camp_drupal_ua
 
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
camp_drupal_ua
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
camp_drupal_ua
 

Plus de camp_drupal_ua (20)

Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...
 
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
 
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
 
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
 
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
 
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
 
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
 
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
 
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
 
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
 
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
 
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
 
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
 
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
 
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
 
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
 
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011

  • 4. 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.
  • 5. 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.
  • 7. Common information 1. Drush == drupal shell == 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]»
  • 8. 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…
  • 9. 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
  • 10. 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]
  • 11. Part 2 Extend Drush features with other modules.
  • 12. 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.
  • 13. Modules, which I like 1. Devel. 2. Drush Make. 3. Module Builder. 4. Drush Cleanup. 5. Backup and Migrate.
  • 14. 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. ...
  • 15. 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.
  • 16. 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"
  • 17. 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
  • 18. 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.
  • 19. Part 3 How Drush helps during development process.
  • 20. 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.
  • 21. 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, ...
  • 22. 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/
  • 23. 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]
  • 24. 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.
  • 25. 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.
  • 26. 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...
  • 27. 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