The Hatchet Command Line Interface is build around the Symfony3 Console Component. You can read more about it here including how to create a command.
Using the CLI
Make sure you've changed to the directory of the project in Terminal/Command Prompt.
You can run the following to see what commands are available:
Writing your own commands
This sections assumes you already have a Bundle created. To learn more about Bundles click here.
All commands must follow the following rules:
- The class name must end with
- All commands must be in a
Commandfolder within your Bundle
Below is an example of a command:
You can run the above command by running the following:
Using the Dependency Injection Container in a command
If you have your command implement
Tomahawk\DependencyInjection\ContainerAwareInterface or use the
Tomahawk\DependencyInjection\ContainerAwareTrait it will get passed in for you.
You will they have access to it through