Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hmazter/console-skeleton
PHP skeleton for a console application with DI-container and yaml-config
https://github.com/hmazter/console-skeleton
Last synced: 4 days ago
JSON representation
PHP skeleton for a console application with DI-container and yaml-config
- Host: GitHub
- URL: https://github.com/hmazter/console-skeleton
- Owner: hmazter
- License: mit
- Created: 2018-03-14T19:36:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-23T11:38:30.000Z (over 2 years ago)
- Last Synced: 2024-12-21T00:33:57.219Z (7 days ago)
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Console Skeleton
================[![Latest Stable Version](https://poser.pugx.org/hmazter/console-skeleton/v/stable)](https://packagist.org/packages/hmazter/console-skeleton)
[![Total Downloads](https://poser.pugx.org/hmazter/console-skeleton/downloads)](https://packagist.org/packages/hmazter/console-skeleton)
[![License](https://poser.pugx.org/hmazter/console-skeleton/license)](https://packagist.org/packages/hmazter/console-skeleton)Skeleton for a console application, including:
* DI-Container
* Services and commands [autowired in yaml-config](config/services.yaml)
* [Example Command](src/Command/ExampleCommand.php)
* [Example test](tests/Command/ExampleCommandTest.php)
* [Phar Builder](https://github.com/clue/phar-composer)## Getting started
This will create a new project with the skeleton for a console application:
```bash
composer create-project hmazter/console-skeleton the-new-app-name
cd the-new-app-name
```The skeleton can then be executed with:
```bash
./app
```### Building distributable phar
A phar-file that can be distributed can be built with:
```bash
composer build
```This will output the phar-file in the project root, named `.phar`.
### Running with docker
Build the app with:
```bash
docker-compose build
```And run the app with docker with this command:
```bash
docker-compose run console ./app
```### Tests
Tests can be run with:
```bash
composer test
```### Static Code analyse
Code can be static analysed with [PHPStan](https://phpstan.org/):
```bash
composer analyse
```### Continue building
Go ahead and:
* Edit/replace command in src/Commad/ExampleCommand
* Add more commands in src/Command
* Add additional classed that you need in src/
* Edit/replace the test in tests/Command/ExampleCommandTest