https://github.com/skoro/php-project
A project skeleton in pure php
https://github.com/skoro/php-project
php pure-php
Last synced: about 1 year ago
JSON representation
A project skeleton in pure php
- Host: GitHub
- URL: https://github.com/skoro/php-project
- Owner: skoro
- Created: 2023-07-22T14:08:19.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-20T17:47:32.000Z (almost 3 years ago)
- Last Synced: 2025-02-09T18:25:14.982Z (over 1 year ago)
- Topics: php, pure-php
- Language: PHP
- Homepage:
- Size: 2.62 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Project skeleton
A project skeleton in pure php. This skeleton can be used to prototype
some simple services where the usage of a framework is over bloated.
## Getting started
There is two choices of running the application:
1. php-fpm
2. swoole
All those build by default as `app` and `app-server` containers.
```shell
docker-compose up -d
```
## Routes
Routes are defined in `./src/Http/routes.php` file. The callback accepts the request method and the uri.
Only static routes are allowed, if you need some dynamic, please use query arguments.
The `/status` route is predefined and returns a response with some system info.
## Logging
There are two available functions for logging:
- `logger(string $message, array $context)` which rely on [error_log](https://www.php.net/manual/en/function.error-log.php)
function.
- `report_error(\Throwable $e, array $context)` as `logger` but also sends an exception to [Sentry](https://sentry.io)
when `SENTRY_DSN` constant is defined.
## Documentation
[swagger-php](http://zircote.github.io/swagger-php/) is used for generating documentation
in OpenAPI format:
```shell
composer make-api
```
## Tests
```shell
composer test
composer check
```
## Missing features:
- DI
- Advanced routing
- Database