| 1 |
// $Id: README.txt,v 1.28 2009/10/26 12:38:16 weitzman Exp $
|
| 2 |
|
| 3 |
DESCRIPTION
|
| 4 |
-----------
|
| 5 |
drush is a command line shell and Unix scripting interface for Drupal.
|
| 6 |
|
| 7 |
Drush core ships with lots of useful commands for interacting with code
|
| 8 |
like modules/themes/profiles. Similarly, it runs update.php, executes sql
|
| 9 |
queries and DB migrations, and misc utilities like run cron or clear cache.
|
| 10 |
|
| 11 |
INSTALLATION
|
| 12 |
------------
|
| 13 |
For Linux/Unix/Mac:
|
| 14 |
1. Untar the tarball into a folder outside of your web site (/path/to/drush)
|
| 15 |
2. Make the 'drush' command executable:
|
| 16 |
$ chmod u+x /path/to/drush/drush
|
| 17 |
3. (Optional, but recommended:) To ease the use of drush,
|
| 18 |
- create a link to drush in a directory that is in your $PATH, e.g.:
|
| 19 |
$ ln -s /path/to/drush/drush /usr/bin/drush
|
| 20 |
OR
|
| 21 |
- create an alias to drush:
|
| 22 |
$ alias drush='/path/to/drush/drush'
|
| 23 |
(this goes into .profile or .bash_aliases in your home folder)
|
| 24 |
|
| 25 |
NOTE FOR ADVANCED USERS
|
| 26 |
- If you want to run drush with a specific version of php, rather than the
|
| 27 |
one found by the drush command, you can instead create an alias that
|
| 28 |
executes the drush.php file directly:
|
| 29 |
$ alias drush='/path/to/php/php5 /path/to/drush/drush.php'
|
| 30 |
If you do this, to allow Drush to detect the number of available columns,
|
| 31 |
you need to add the line 'export COLUMNS' to the .profile file in your
|
| 32 |
home folder.
|
| 33 |
|
| 34 |
4. Start using drush by running "drush" from your Drupal root directory.
|
| 35 |
|
| 36 |
(or, if you did not follow step 3, by running "/path/to/drush/drush"
|
| 37 |
or navigating to /path/to/drush and running "./drush" )
|
| 38 |
|
| 39 |
If you have troubles, try using the -l and -r parameters when invoking drush. See below.
|
| 40 |
|
| 41 |
For Windows:
|
| 42 |
- Follow step 1. Use drush by navigating to /path/to/drush
|
| 43 |
and running 'drush.bat'.
|
| 44 |
- Whenever the documentation or the help text refers to
|
| 45 |
'drush [option] <command>' or something similar, 'drush' has to be replaced
|
| 46 |
by 'drush.bat'.
|
| 47 |
- If drush.bat is not working for you, either add the directory in which your
|
| 48 |
php.exe resides to your PATH or edit drush.bat to point to your php.exe.
|
| 49 |
|
| 50 |
USAGE
|
| 51 |
-----
|
| 52 |
Once installed and setup (see above), you can use drush as follows while in
|
| 53 |
any Drupal directory:
|
| 54 |
|
| 55 |
$ drush [options] <command>
|
| 56 |
|
| 57 |
Use the 'help' command to get a list of available options and commands:
|
| 58 |
|
| 59 |
$ drush help
|
| 60 |
|
| 61 |
For multisite installations, you might need to use the -l or other command line
|
| 62 |
options just to get drush to work:
|
| 63 |
|
| 64 |
$ drush -l http://example.com help
|
| 65 |
|
| 66 |
Related Options:
|
| 67 |
-r <path>, --root=<path> Drupal root directory to use
|
| 68 |
(default: current directory or anywhere in a Drupal directory tree)
|
| 69 |
-l <uri> , --uri=<uri> URI of the drupal site to use
|
| 70 |
(only needed in multisite environments)
|
| 71 |
-v, --verbose Display all available output
|
| 72 |
|
| 73 |
Some other options:
|
| 74 |
-i <path>, --include=<path> Path to folder(s) containing additional drush command files.
|
| 75 |
Follows the POSIX convention of separating paths with a ':'
|
| 76 |
|
| 77 |
If you get tired of typing options all the time, you can add them to your drush.php alias or
|
| 78 |
create a drushrc.php file. These provide additional options for your drush call. They provide
|
| 79 |
great flexibility for a multi-site installation, for example. See example.drushrc.php.
|
| 80 |
|
| 81 |
COMMANDS
|
| 82 |
--------
|
| 83 |
Drush ships with a number of commands, but you can easily write
|
| 84 |
your own. In fact, writing a drush command is no harder that writing simple
|
| 85 |
Drupal extensions, since drush command files closely follows the structure of
|
| 86 |
ordinary Drupal modules.
|
| 87 |
|
| 88 |
See example.drush.inc for details on the internals of a drush command
|
| 89 |
file.
|
| 90 |
|
| 91 |
You can put your drush command file in a number of places:
|
| 92 |
|
| 93 |
- In a .drush folder in your HOME folder. Note, that you have
|
| 94 |
to make the .drush folder yourself.
|
| 95 |
- Along with one of your existing modules. If your command is
|
| 96 |
related to an existing module, this is the preferred option.
|
| 97 |
- In a folder specified with the include option (see above).
|
| 98 |
- In /path/to/drush/commands (not a Smart Thing, but it would work).
|
| 99 |
|
| 100 |
In any case, it is important that you append it with ".drush.inc", so
|
| 101 |
that drush can find it.
|
| 102 |
|
| 103 |
REQUIREMENTS
|
| 104 |
------------
|
| 105 |
* To use drush from the command line, you'll need a CLI-mode capable PHP
|
| 106 |
binary. The minimum required PHP version is 5.2.
|
| 107 |
* drush should also run on Windows, however, drush modules makes use of
|
| 108 |
unix command line tools, so to use it effectively, you have to install
|
| 109 |
some of them, e.g. from GnuWin32 (http://gnuwin32.sourceforge.net/).
|
| 110 |
|
| 111 |
FAQ
|
| 112 |
---
|
| 113 |
Q: What does "drush" stand for?
|
| 114 |
A: The Drupal Shell.
|
| 115 |
|
| 116 |
Q: How do I pronounce drush?
|
| 117 |
A: Some people pronounce the dru with a long u like drupal. Fidelity points goes to
|
| 118 |
them, but they are in the minority. Most pronouce drush so that it rhymes with
|
| 119 |
hush, rush, flush, etc. This is the preferred pronunciation.
|
| 120 |
|
| 121 |
CREDITS
|
| 122 |
-------
|
| 123 |
Originally developed by Arto Bendiken <http://bendiken.net/> for Drupal 4.7.
|
| 124 |
Redesigned by Franz Heinzmann (frando) <http://unbiskant.org/> in May 2007 for Drupal 5.
|
| 125 |
Maintained by Moshe Weitzman <http://drupal.org/moshe> with much help from
|
| 126 |
Grugnog2, Adrian Rossouw, and Vingborg.
|