5b03ebef89f8b431dda58e09b361ce3f01005007
[yaffs-website] / vendor / drush / drush / docs / install.md
1 Install/Upgrade a global Drush
2 ---------------
3 ```bash    
4 # Browse to https://github.com/drush-ops/drush/releases and download the drush.phar attached to the latest 8.x release.
5
6 # Test your install.
7 php drush.phar core-status
8
9 # Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. 
10 chmod +x drush.phar
11 sudo mv drush.phar /usr/local/bin/drush
12
13 # Optional. Enrich the bash startup file with completion and aliases.
14 drush init
15 ```
16     
17 * MAMP users, and anyone wishing to launch a non-default PHP, needs to [edit ~/.bashrc so that the right PHP is in your $PATH](http://stackoverflow.com/questions/4145667/how-to-override-the-path-of-php-to-use-the-mamp-path/10653443#10653443).
18 * We have documented [alternative ways to install](http://docs.drush.org/en/8.x/install-alternative/), including [Windows](http://docs.drush.org/en/8.x/install-alternative/#windows).
19 * If you need to pass custom php.ini values, run `php -d foo=bar drush.phar --php-options=foo=bar`
20 * Your shell now has [useful bash aliases and tab completion for command names, site aliases, options, and arguments](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.bashrc).
21 * A [drushrc.php](https://raw.githubusercontent.com/drush-ops/drush/8.x/examples/example.drushrc.php) has been copied to ~/.drush above. Customize it to save typing and standardize options for commands.
22 * Upgrade using this same procedure.
23
24 Install a site-local Drush
25 -----------------
26 In addition to the global Drush, it is recommended that Drupal 8 sites be [built using Composer, with Drush listed as a dependency](https://github.com/drupal-composer/drupal-project).
27
28 1. When you run `drush`, the global Drush is called first and then hands execution to the site-local Drush. This gives you the convenience of running `drush` without specifying the full path to the executable, without sacrificing the safety provided by a site-local Drush.
29 2. Optional: Copy the [examples/drush.wrapper](https://github.com/drush-ops/drush/blob/8.x/examples/drush.wrapper) file to your project root and modify to taste. This is a handy launcher script; add --local here to turn off all global configuration locations, and maintain consistency over configuration/aliases/commandfiles for your team.
30 3. Note that if you have multiple Drupal sites on your system, it is possible to use a different version of Drush with each one.
31
32 Drupal Compatibility
33 -----------------
34 !!! note
35
36     Drush 9 only supports one install method. It requires that your Drupal 8 site be built with Composer and Drush be listed as a dependency. 
37     
38     See the [Drush 8 docs](http://docs.drush.org/en/8.x) for installing prior versions of Drush.
39
40 Install a site-local Drush and Drush Launcher.
41 -----------------
42 1. It is recommended that Drupal 8 sites be [built using Composer, with Drush listed as a dependency](https://github.com/drupal-composer/drupal-project). That project already includes Drush in its composer.json. If your Composer project doesn't yet depend on Drush, run `composer require drush/drush` to add it. 
43 1. To be able to call `drush` from anywhere, install the [Drush Launcher](https://github.com/drush-ops/drush-launcher). That is a small program which listens on your $PATH and hands control to a site-local Drush that is in the /vendor directory of your Composer project. If you skip this step, run Drush from Drupal root via `../vendor/bin/drush`. In that case Drush's bash integration and custom prompt won't work.
44 1. Run `drush init`. This edits ~/.bashrc so that Drush's custom prompt and bash integration are active.
45 1. See [Usage](http://docs.drush.org/en/master/usage/) for details on using Drush.
46 1. To use a non-default PHP, [edit ~/.bashrc so that the desired PHP is in front of your $PATH](http://stackoverflow.com/questions/4145667/how-to-override-the-path-of-php-to-use-the-mamp-path/10653443#10653443). If that is not desirable, you can change your PATH for just one request: `PATH=/path/to/php:$PATH` drush status ...`
47
48 !!! note
49
50     Drush 9 cannot run commandfiles from Drush 8 and below (e.g. example.drush.inc). See our [guide on porting commandfiles](https://weitzman.github.io/blog/port-to-drush9). Also note that alias and config files use a new .yml format in Drush 9.
51
52 Drupal Compatibility
53 -----------------
54 <table>
55   <tr>
56     <th> Drush Version </th> 
57     <th> Drush Branch </th>
58     <th> PHP </th>
59     <th> Compatible Drupal versions </th>
60     <th> Code Style </th>
61     <th> Isolation Tests </th>
62     <th> Functional Tests </th>
63   </tr>
64   <tr>
65     <td> Drush 9 </td>
66     <td> <a href="https://travis-ci.org/drush-ops/drush">master</a> </td>
67     <td> 5.6+ </td>
68     <td> D8.4+ </td>
69     <td align="center">
70       <img src="https://api.shippable.com/projects/5507addd5ab6cc1352a213b5/badge?branch=master" />
71     </td>
72     <td align="center">
73       <img src="https://travis-ci.org/drush-ops/drush.svg?branch=master" />
74     </td>
75     <td align="center">
76       <img src="https://circleci.com/gh/drush-ops/drush.svg?style=shield" />
77     </td>
78   </tr>
79   <tr>
80     <td> Drush 8 </td>
81     <td> <a href="https://travis-ci.org/drush-ops/drush">8.x</a> </td>
82     <td> 5.4.5+ </td>
83     <td> D6, D7, D8.3- </td>
84     <td align="center">
85       <img src="https://circleci.com/gh/drush-ops/drush.svg?branch=8.x&style=shield" />
86     </td>
87     <td align="center">
88       -
89     </td>
90     <td align="center">
91       <img src="https://travis-ci.org/drush-ops/drush.svg?branch=8.x" />
92     </td>
93   </tr>
94   <tr>
95     <td> Drush 7 </td>
96     <td> <a href="https://travis-ci.org/drush-ops/drush">7.x</a> </td>
97     <td> 5.3.0+ </td>
98     <td> D6, D7 </td>
99     <td colspan="3" align="center"> Unsupported </td>
100   </tr>
101   <tr>
102     <td> Drush 6 </td>
103     <td> <a href="https://travis-ci.org/drush-ops/drush">6.x</a> </td>
104     <td> 5.3.0+ </td>
105     <td> D6, D7 </td>
106     <td colspan="3" align="center"> Unsupported </td>
107   </tr>
108   <tr>
109     <td> Drush 5 </td>
110     <td> <a href="https://travis-ci.org/drush-ops/drush">5.x</a> </td>
111     <td> 5.2.0+ </td>
112     <td> D6, D7 </td>
113     <td colspan="3" align="center"> Unsupported </td>
114   </tr>
115 </table>