Skip to content

Commit

Permalink
Fix #3145. Link to DI docs from command authoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Nov 7, 2017
1 parent 51ea835 commit 9af44c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Creating a new Drush command or porting a legacy command is easy. Follow the ste
1. Drush will prompt for the machine name of the module that should "own" the file.
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)
1. Drush will then report that it created a commandfile and a drush.services.yml file. Edit those 2 files as needed.
1. Use the classes for the core Drush commands at /src/Drupal/Commands as inspiration and documentation.
1. Use the classes for the core Drush commands at /src/Drupal/Commands as inspiration and documentation.
1. See the [dependency injection docs](dependency-injection.md) for interfaces you can implement to gain access to Drush config, Drupal site aliases, etc.
1. Once your two files are ready, run `drush cr` to get your command recognized by the Drupal container.

Global Drush Commands
Expand Down
2 changes: 1 addition & 1 deletion docs/dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ All Drush command files extend DrushCommands; DrushCommands implements IOAwareIn

Any additional services that are desired must be injected by implementing the appropriate inflection interface.

Available Drush Services
Available Interfaces:

- AutoloaderAwareInterface: Provides access to the class loader.
- SiteAliasManagerAwareInterface: The site alias manager [allows alias records to be obtained](site-alias-manager.md).
Expand Down

0 comments on commit 9af44c2

Please sign in to comment.