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.
Version 4 is finally adding basic functional API tests and Code Quality tools.
docker-compose up -d
make composer-install
make mysql-import build/mysql/database.sql
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
make test
to execute the default test suite.
make cs
- run Code Sniffermake csfix
- run Code Sniffer Fixermake analyze
- run Code Analyzer