Skeleton for a console application, including:
- DI-Container
- Services and commands autowired in yaml-config
- Example Command
- Example test
- Phar Builder
This will create a new project with the skeleton for a console application:
composer create-project hmazter/console-skeleton the-new-app-name
cd the-new-app-nameThe skeleton can then be executed with:
./appA phar-file that can be distributed can be built with:
composer buildThis will output the phar-file in the project root, named <project-directory-name>.phar.
Build the app with:
docker-compose buildAnd run the app with docker with this command:
docker-compose run console ./appTests can be run with:
composer testCode can be static analysed with PHPStan:
composer analyseGo ahead and:
- Edit/replace command in src/Commad/ExampleCommand
- Add more commands in src/Command
- Add additional classes that you need in src/
- Edit/replace the test in tests/Command/ExampleCommandTest