https://github.com/firehed/php-project-template
https://github.com/firehed/php-project-template
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/firehed/php-project-template
- Owner: Firehed
- License: mit
- Created: 2021-11-04T16:27:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-02T11:00:11.000Z (over 3 years ago)
- Last Synced: 2025-02-13T22:27:01.783Z (over 1 year ago)
- Language: PHP
- Size: 149 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-project-template
Repository template for PHP projects. Sets up composer, docker builds CI with Github Actions, and more.
## PHP
- Ships with version `8.1`
- Includes `apcu` and `opcache` extensions for performance
- Includes `pdo-mysql` as a default database connector
### Code Quality
- Includes PHPUnit, PHPCS, and PHPStan
- All are preconfigured and run during CI (See below)
### Configuration
- Provides a PSR-11 container for DI
- Sets up support for `.env`
## Git
- Configures `.gitignore` for common excludes in a PHP project
## Docker
- Comes with a preconfigured basic Dockerfile
- Comes with a preconfigured `docker-compose` file
- Produces build stages for testing and deployment
- **You will want to customize it**: it uses the built-in web-server, which is _not_ production-ready
- `.dockerignore` also included for build optimizations
## Composer
- Placeholders for library name, description, and PSR-4 autoloading
- Scripts for testing
- Requires current version of PHP
- Includes testing tools (configured) as dev dependencies
## Database
- Comes with MySQL 8 in docker-compose, and the application configured to connect to it
- Comes with `doctrine/orm` pre-configured (using PHP 8 Attributes)
- Comes with `doctrine/migrations` pre-configured for schema changes
## Testing and CI
CI is configured using Github Actions.
- PHPUnit `^9.3` with default configuration (`src`/`tests`).
- Produces code coverage report
- Uploads to `codecov`
- PHPStan with strict ruleset, max level, and the PHPUnit extension
- PHP Code Sniffer configured with PSR-12
- Builds and pushes Docker images. The `server` stage is what you'll want to run