https://github.com/carstenwindler/frameworkless
An example about how to code a simple webservice in PHP without the use of frameworks.
https://github.com/carstenwindler/frameworkless
frameworkless php webservice
Last synced: 9 months ago
JSON representation
An example about how to code a simple webservice in PHP without the use of frameworks.
- Host: GitHub
- URL: https://github.com/carstenwindler/frameworkless
- Owner: carstenwindler
- Created: 2021-05-28T21:00:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-10T20:35:45.000Z (about 2 years ago)
- Last Synced: 2025-03-24T22:42:00.569Z (10 months ago)
- Topics: frameworkless, php, webservice
- Language: PHP
- Homepage:
- Size: 104 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Frameworkless Webservice
This repository is an example about how to code a simple webservice in PHP without the use of frameworks.
> Please note, this is not meant to be used in production. Use it on your own risk.
## V4 - adding tests and code quality tools
Version 4 is finally adding basic functional API tests and Code Quality tools.
### Installation
```
docker-compose up -d
make composer-install
make mysql-import build/mysql/database.sql
```
### Usage
```
curl -u username:password -X GET http://localhost:8080/products
curl -u username:password -X GET http://localhost:8080/products/1
curl -u username:password -X POST localhost:8080/products -d '{ "description": "new item" }' -H "Content-Type: application/json"
curl -u username:password -X PUT localhost:8080/products/2 -d '{ "description": "updated" }' -H "Content-Type: application/json"
curl -u username:password -X DELETE localhost:8080/products/2
```
### Tests
* `make test` to execute the default test suite.
### Code Quality
* `make cs` - run Code Sniffer
* `make csfix` - run Code Sniffer Fixer
* `make analyze` - run Code Analyzer