You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Drush is built by people like you! Please [join us](https://github.com/drush-ops/drush).
2
2
3
3
## Git and Pull requests
4
-
* Contributions are submitted, reviewed, and accepted using Github pull requests. [Read this article](https://help.github.com/articles/using-pull-requests) for some details. We use the _Fork and Pull_ model, as described there.
4
+
* Contributions are submitted, reviewed, and accepted using GitHub pull requests. [Read this article](https://help.github.com/articles/using-pull-requests) for some details. We use the _Fork and Pull_ model, as described there.
5
5
* The latest changes are in the `master` branch. PR's should initially target this branch.
6
6
* Try to make clean commits that are easily readable (including descriptive commit messages!)
7
7
* Test before you push. Get familiar with Unish, our test suite. See the test-specific [README.md](tests/README.md)
* Subscribe [this atom feed](https://github.com/drush-ops/drush/releases.atom) to receive notification of new releases. Also, [Version eye](https://www.versioneye.com/).
12
16
*[Drush packages available via Composer](https://packagist.org/search/?type=drupal-drush)
13
17
*[A list of modules that include Drush integration](https://www.drupal.org/project/project_module?f[2]=im_vid_3%3A4654&solrsort=ds_project_latest_release+desc)
14
-
* Drush comes with a [full test suite](https://github.com/drush-ops/drush/blob/master/tests/README.md) powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by the awesome [Travis.ci continuous integration service](https://travis-ci.org/drush-ops/drush).
18
+
* Drush comes with a [full test suite](https://github.com/drush-ops/drush/blob/master/tests/README.md) powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by the awesome [Travis CI continuous integration service](https://travis-ci.org/drush-ops/drush).
15
19
16
20
Support
17
21
-----------
@@ -35,7 +39,7 @@ FAQ
35
39
> rhymes with hush, rush, flush, etc. This is the preferred pronunciation.
36
40
>
37
41
> Q: Does Drush have unit tests?<br>
38
-
> A: Drush has an excellent suite of unit tests. See
42
+
> A: Drush has an excellent suite of unit tests. See
39
43
> [tests/README.md](https://github.com/drush-ops/drush/blob/master/tests/README.md) for more information.
Copy file name to clipboardExpand all lines: composer.json
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "drush/drush",
3
3
"description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.",
Copy file name to clipboardExpand all lines: docs/bootstrap.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ When preparing to run a command, Drush works by "bootstrapping" the Drupal envir
4
4
5
5
For efficiency and convenience, some Drush commands can work without first bootstrapping a Drupal site, or by only partially bootstrapping a site. This is faster than a full bootstrap. It is also a matter of convenience, because some commands are useful even when you don't have a working Drupal site.
6
6
7
-
Commands may specify their bootstrap level with a `@bootstrap` annotation. Commands supplied by Drupal modules are `@bootstrap max`.
7
+
Commands may specify their bootstrap level with a `@bootstrap` annotation. Commands supplied by Drupal modules are always `@bootstrap full`.
Copy file name to clipboardExpand all lines: docs/commands.md
+27-6Lines changed: 27 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Creating a new Drush command or porting a legacy command is easy. Follow the ste
8
8
1. (optional) Drush will also prompt for the path to a legacy command file to port. See [tips on porting command to Drush 9](https://weitzman.github.io/blog/port-to-drush9)
9
9
1. The module selected must already exist and be enabled. Use `drush generate module-standard` to create a new module.
10
10
1. Drush will then report that it created a commandfile, a drush.services.yml file and a composer.json file. Edit those files as needed.
11
-
1. Use the classes for the core Drush commands at /src/Drupal/Commands as inspiration and documentation.
11
+
1. Use the classes for the core Drush commands at [/src/Drupal/Commands](https://github.com/drush-ops/drush/tree/master/src/Drupal/Commands) as inspiration and documentation.
12
12
1. See the [dependency injection docs](dependency-injection.md) for interfaces you can implement to gain access to Drush config, Drupal site aliases, etc.
13
13
1. Once your two files are ready, run `drush cr` to get your command recognized by the Drupal container.
14
14
@@ -42,15 +42,36 @@ It is also possible to use [version ranges](https://getcomposer.org/doc/articles
42
42
43
43
In Drush 9, the default services file, `drush.services.yml`, will be used in instances where there is no `services` section in the Drush extras of the project's composer.json file. In Drush 10, however, the services section must exist, and must name the services file to be used. If a future Drush extension is written such that it only works with Drush 10 and later, then its entry would read `"drush.services.yml": "^10"`, and Drush 9 would not load the extension's commands. It is all the same recommended that Drush 9 extensions explicitly declare their services file with an appropriate version constraint.
44
44
45
+
Altering Drush Command Info
46
+
===========================
47
+
48
+
Drush command info (annotations) can be altered from other modules. This is done by creating and registering 'command info alterers'. Alterers are class services that are able to intercept and manipulate an existing command annotation.
49
+
50
+
In order to alter an existing command info, follow the next steps:
51
+
52
+
1. In the module that wants to alter a command info, add a service class that implements the `\Consolidation\AnnotatedCommand\CommandInfoAltererInterface`.
53
+
1. In the module `drush.services.yml` declare a service pointing to this class and tag the service with the `drush.command_info_alterer` tag.
54
+
1. In the class implement the alteration logic the `alterCommandInfo()` method.
55
+
1. Along with the alter code, it's strongly recommended to log a debug message explaining what exactly was altered. This would allow the easy debugging. Also it's a good practice to inject the the logger in the class constructor.
56
+
57
+
For an example, see the alterer class provided by the testing 'woot' module: `tests/resources/modules/d8/woot/src/WootCommandInfoAlterer.php`.
58
+
45
59
Global Drush Commands
46
60
==============================
47
61
48
-
Commandfiles that don't ship inside Drupal modules are called 'global' commandfiles. See the examples/Commands folder for examples. In general, its better to use modules to carry your Drush commands. If you still prefer using a global commandfiles, please note:
62
+
Commandfiles that don't ship inside Drupal modules are called 'global' commandfiles. See the [examples/Commands](/examples/Commands) folder for examples. In general, it's better to use modules to carry your Drush commands. If you still prefer using a global commandfiles, here are two examples of valid commandfile names and namespaces:
0 commit comments