Drush - это интерфейс командной строки для доступа к вашему сайту на Drupal.
С помощью данного инструмента вы можете выполнять рутинные действия не прибегая к вебинтерфейсу Друпала, что значительно упрощает работу веб-разработчика.
1. Будут рассмотрены основные команды при работе с сайтом на базе Друпал;
2. Установка под Linux и особенности при установке в Windows;
3. Использование при работе с популярными модулями.
4. Возможности использования следуя принципам Coding drive development-а.
5. Drush4 API
6. Пример разработки своих команд для работы с Друпал сайтом.
4. Scheme
Administration of drupal by command line:
main benefits.
Most interesting ways of using.
How this work.
Drush_macros: simple drush extention for
example.
5. Administration of drupal by
command line: main benefits
Drush: More Beer, Less Effort:
Save time
Forgot about php timeout (and some restrictions of php)
Don't need remember all.
Automatization (repeating of actions)
6. Forgot about php timeout (and
some other restrictions of php)
We can hadle have processes
Batch processes
Using bash scripts
7. Don't need remember all.
We can pay more attention on development
Forgot about some issues in drupal web-
interface using
Don't need pay too many attention for file
system (locations of some module folder and
other)
8. Automatization (repeating of
actions)
Use bash aliases
Launching by cron
Launching commands queue by 1 command
9. Most interesting ways of using.
Installation in Ubuntu
Installation in Unix-like operation systems
Installation in MS Windows
Main commands in possibilities
13. Solving
Instractions for drush installation in Windows:
http://drupal.org/node/594744
http://www.starbowconsulting.com/node/103
http://vimeo.com/15371661 — Video installation WAMP, Drush & Drupal for Windows 7
Required packages:
http://gnuwin32.sourceforge.net/packages/libarchive.htm
http://gnuwin32.sourceforge.net/packages/gzip.htm
http://gnuwin32.sourceforge.net/packages/wget.htm
http://gnuwin32.sourceforge.net/packages/gtar.htm
Environment Pathes: ;C:php;C:drush;C:Program Files (x86)GnuWin32bin
Where is work:
Windows server 2008, Windows server 2008, Windows Vista 64-bit Business, Windows Vista 32-bit Business, Windows Vista
32-bit Home Premium, Windows XP SP3 32-bit, Windows 7 Home Premium 32-bit, Windows 7 Enterprise 64-bit
14. Use cases
cache-clear (cc) - Clearing of cache
image-flush - Fushes images of image-styles
site-install
site-upgrade
и т.д.
15. Coding drive development
and drush
features-diff
features-list
features-revert
features-update
20. Create COMMANDFILE.drush.inc
Drush searches for commandfiles in the following
locations:
The "/path/to/drush/commands" folder.
Folders listed in the 'include' option (see
`drush topic docs-configuration`).
The system-wide drush commands folder,
e.g. /usr/share/drush/commands
The ".drush" folder in the user's HOME folder.
All modules in the current Drupal installation
22. Implement
COMMANDFILE_drush_command()
'aliases': Provides a list of shorter names for the command.
'deprecated-aliases': Works just like 'aliases', but does not appear in help.
'callback': Name of function to invoke for this command
'callback arguments': An array of arguments to pass to the callback.
'description': Description of the command.
'bootstrap': Drupal bootstrap level. Valid values are:
DRUSH_BOOTSTRAP_DRUSH
DRUSH_BOOTSTRAP_DRUPAL_ROOT
DRUSH_BOOTSTRAP_DRUPAL_SITE
DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION
DRUSH_BOOTSTRAP_DRUPAL_DATABASE
DRUSH_BOOTSTRAP_DRUPAL_FULL
DRUSH_BOOTSTRAP_DRUPAL_LOGIN
DRUSH_BOOTSTRAP_MAX
24. Drush_macros: simple drush
extention for example.
Link for downloading will be later
Aim: recording and launching commands by 1
commands, recording drush/bash commands,
saving in drush inveronment
25. Using drush_macros
drush cli
mstart — start «recording» bash/drush commands
mstop — stop «recording» bash/drush commands
macros-save — save queue of commands by 1
name
exit — exit from drush cli mode
After that we can run queue of commands by 1
command in drush cli