| 1 |
// $Id: README.txt,v 1.18 2009/02/05 17:24:10 damz Exp $
|
| 2 |
|
| 3 |
DESCRIPTION
|
| 4 |
-----------
|
| 5 |
drush is a command line shell and Unix scripting interface for Drupal, a
|
| 6 |
veritable Swiss Army knife designed to make life easier for those of us who
|
| 7 |
spend many hours hacking away at the command prompt.
|
| 8 |
|
| 9 |
Green text against a black background is optional. Perhaps you would like
|
| 10 |
some alpha-channel translucency with that? ;)
|
| 11 |
|
| 12 |
Drush core ships with lots of useful commands for interacting with code
|
| 13 |
like modules/themes/profiles. Similarly, it run update.php, execute sql
|
| 14 |
queries and DB migrations, and misc utilities like run cron or clear cache.
|
| 15 |
|
| 16 |
INSTALLATION
|
| 17 |
------------
|
| 18 |
For Linux/Unix/Mac:
|
| 19 |
1. Untar the tarball into a folder outside of your web site (/path/to/drush)
|
| 20 |
2. (Optional, but recommended:) To ease the use of drush,
|
| 21 |
- create a link to drush.php in a directory that is in your $PATH, e.g.:
|
| 22 |
$ ln -s /path/to/drush/drush.php /usr/bin/drush
|
| 23 |
OR
|
| 24 |
- create an alias to drush.php:
|
| 25 |
$ alias drush='php /path/to/drush/drush.php'
|
| 26 |
(this goes into .profile or .bash_aliases in your home folder)
|
| 27 |
|
| 28 |
3. Start using drush by running "drush" from your Drupal root directory.
|
| 29 |
|
| 30 |
(or, if you did not follow step 2, by running "/path/to/drush/drush.php"
|
| 31 |
or navigating to /path/to/drush and running "./drush.php" )
|
| 32 |
|
| 33 |
If you have troubles, try using the -l and -r flags when invoking drush.php. See below.
|
| 34 |
|
| 35 |
For Windows (experimental!):
|
| 36 |
- Follow step 1. Use drush by navigating to /path/to/drush
|
| 37 |
and running 'drush.bat'.
|
| 38 |
- Whenever the documentation or the help text refers to
|
| 39 |
'drush [option] <command>' or something similar, 'drush' has to be replaced
|
| 40 |
by 'drush.bat'.
|
| 41 |
- If drush.bat is not working for you, either add the directory in which your
|
| 42 |
php.exe resides to your PATH or edit drush.bat to point to your php.exe.
|
| 43 |
|
| 44 |
USAGE
|
| 45 |
-----
|
| 46 |
Once installed and setup (see above), you can use drush as follows while in
|
| 47 |
any Drupal directory:
|
| 48 |
|
| 49 |
$ drush [options] <command>
|
| 50 |
|
| 51 |
Use the 'help' command to get a list of available options and commands:
|
| 52 |
|
| 53 |
$ drush help
|
| 54 |
|
| 55 |
For multisite installations, you might need to use the -l or other command line
|
| 56 |
options just to get drush to work:
|
| 57 |
|
| 58 |
$ drush -l http://example.com help
|
| 59 |
|
| 60 |
Related Options:
|
| 61 |
-r <path>, --root=<path> Drupal root directory to use
|
| 62 |
(default: current directory or anywhere in a Drupal directory tree)
|
| 63 |
-l <uri> , --uri=<uri> URI of the drupal site to use
|
| 64 |
(only needed in multisite environments)
|
| 65 |
-v, --verbose Display all available output
|
| 66 |
|
| 67 |
Other options:
|
| 68 |
-i <path>, --include=<path> Path to folder(s) containing additional drush command files.
|
| 69 |
Follows the POSIX convention of separating paths with a ':'
|
| 70 |
|
| 71 |
If you get tired of typing options all the time, you can add them to your drush.php alias or
|
| 72 |
create a drushrc.php file. These provide additional options for your drush call. They provide
|
| 73 |
great flexibility for a multi-site installation, for example. See example.drushrc.php.
|
| 74 |
|
| 75 |
COMMANDS
|
| 76 |
--------
|
| 77 |
Drush ships with a number of commands (see above), but you can easily write
|
| 78 |
your own. In fact, writing a drush command is no harder that writing simple
|
| 79 |
Drupal extensions, since drush command files closely follows the structure of
|
| 80 |
ordinary Drupal modules.
|
| 81 |
|
| 82 |
See example.drush.inc for details on the internals of a drush command
|
| 83 |
file.
|
| 84 |
|
| 85 |
You can put your drush command file in a number of places:
|
| 86 |
|
| 87 |
- In a .drush folder in your HOME folder. Note, that you have
|
| 88 |
to make the .drush folder yourself.
|
| 89 |
- Along with one of your existing modules. If your command is
|
| 90 |
related to an existing module, this is the preferred option.
|
| 91 |
- In a folder specified with the include option (see above).
|
| 92 |
- In /path/to/drush/commands (not a Smart Thing, but it would work).
|
| 93 |
|
| 94 |
In any case, it is important that you append it with ".drush.inc", so
|
| 95 |
that drush can find it.
|
| 96 |
|
| 97 |
REQUIREMENTS
|
| 98 |
------------
|
| 99 |
This version of drush is designed for Drupal 6.x running on a Unix/Linux
|
| 100 |
platform.
|
| 101 |
|
| 102 |
* To use drush from the command line, you'll need a CLI-mode capable PHP
|
| 103 |
binary. The minimum required PHP version is 4.3.0 (PHP 5.x is OK, too).
|
| 104 |
* drush should also run on Windows, however, drush modules might make use of
|
| 105 |
unix command line tools, so to use it effectively, you have to install
|
| 106 |
some of them, e.g. from GnuWin32 (http://gnuwin32.sourceforge.net/).
|
| 107 |
The READMEs of the individual command files should state which binaries
|
| 108 |
are required.
|
| 109 |
|
| 110 |
FAQ
|
| 111 |
---
|
| 112 |
Q: What does "drush" stand for?
|
| 113 |
A: The Drupal Shell.
|
| 114 |
|
| 115 |
LIMITATIONS
|
| 116 |
-----------
|
| 117 |
* Due to reliance on PHP's tokenizer, drush may not work well in situations
|
| 118 |
where the PHP code for the Drupal code base is encrypted (refer to API.txt
|
| 119 |
for more information). This is unlikely to change.
|
| 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.
|