1- # PHP-CRUD-API (v2)
1+ # PHP-CRUD-API
22
3- Single file PHP 7 script that adds a REST API to a MySQL 5.5 InnoDB database. PostgreSQL 9.1 and MS SQL Server 2012 are fully supported.
3+ Single file PHP 7 script that adds a REST API to a MySQL 5.6 InnoDB database. PostgreSQL 9.1 and MS SQL Server 2012 are fully supported.
44
55NB: This is the [ TreeQL] ( https://treeql.org ) reference implementation in PHP.
66
7- NB: Are you looking for v1? It is here: https://github.com/mevdschee/php-crud-api/tree/v1
8-
97Related projects:
108
119 - [ PHP-API-AUTH] ( https://github.com/mevdschee/php-api-auth ) : Single file PHP script that is an authentication provider for PHP-CRUD-API (v2)
@@ -91,7 +89,7 @@ NB: The script appends the classes in alphabetical order (directories first).
9189
9290## Limitations
9391
94- These limitation were also present in v1 :
92+ These limitation and constrains apply :
9593
9694 - Primary keys should either be auto-increment (from 1 to 2^53) or UUID
9795 - Composite primary or foreign keys are not supported
@@ -101,38 +99,30 @@ These limitation were also present in v1:
10199
102100## Features
103101
104- These features match features in v1 (see branch "v1"):
105-
106- - [x] Single PHP file, easy to deploy.
107- - [x] Very little code, easy to adapt and maintain
108- - [ ] ~~ Streaming data, low memory footprint~~
109- - [x] Supports POST variables as input (x-www-form-urlencoded)
110- - [x] Supports a JSON object as input
111- - [x] Supports a JSON array as input (batch insert)
112- - [ ] ~~ Supports file upload from web forms (multipart/form-data)~~
113- - [ ] ~~ Condensed JSON output: first row contains field names~~
114- - [x] Sanitize and validate input using callbacks
115- - [x] Permission system for databases, tables, columns and records
116- - [x] Multi-tenant database layouts are supported
117- - [x] Multi-domain CORS support for cross-domain requests
118- - [x] Support for reading joined results from multiple tables
119- - [x] Search support on multiple criteria
120- - [x] Pagination, seeking, sorting and column selection
121- - [x] Relation detection with nested results (belongsTo, hasMany and HABTM)
122- - [ ] ~~ Relation "transforms" (of condensed JSON) for PHP and JavaScript~~
123- - [x] Atomic increment support via PATCH (for counters)
124- - [x] Binary fields supported with base64 encoding
125- - [x] Spatial/GIS fields and filters supported with WKT
126- - [ ] ~~ Unstructured data support through JSON/JSONB~~
127- - [x] Generate API documentation using OpenAPI tools
128- - [x] Authentication via JWT token or username/password
129- - [ ] ~~ SQLite support~~
130-
131- NB: No checkmark means: not yet implemented. Striken means: will not be implemented.
102+ The following features are supported:
103+
104+ - Single PHP file, easy to deploy.
105+ - Very little code, easy to adapt and maintain
106+ - Supports POST variables as input (x-www-form-urlencoded)
107+ - Supports a JSON object as input
108+ - Supports a JSON array as input (batch insert)
109+ - Sanitize and validate input using callbacks
110+ - Permission system for databases, tables, columns and records
111+ - Multi-tenant database layouts are supported
112+ - Multi-domain CORS support for cross-domain requests
113+ - Support for reading joined results from multiple tables
114+ - Search support on multiple criteria
115+ - Pagination, seeking, sorting and column selection
116+ - Relation detection with nested results (belongsTo, hasMany and HABTM)
117+ - Atomic increment support via PATCH (for counters)
118+ - Binary fields supported with base64 encoding
119+ - Spatial/GIS fields and filters supported with WKT
120+ - Generate API documentation using OpenAPI tools
121+ - Authentication via JWT token or username/password
132122
133123### Extra Features
134124
135- These features are new and were not included in v1.
125+ These features are new in v2 and were not included in v1:
136126
137127 - Does not reflect on every request (better performance)
138128 - Complex filters (with both "and" & "or") are supported
@@ -144,6 +134,19 @@ These features are new and were not included in v1.
144134 - Support for basic authentication and via auth provider (JWT)
145135 - Support for basic firewall functionality
146136
137+ ### Dropped features
138+
139+ The following features of v1 were dropped in v2:
140+
141+ - ~~ Streaming data, low memory footprint~~
142+ - ~~ Supports file upload from web forms (multipart/form-data)~~
143+ - ~~ Condensed JSON output: first row contains field names~~
144+ - ~~ Relation "transforms" (of condensed JSON) for PHP and JavaScript~~
145+ - ~~ Unstructured data support through JSON/JSONB~~
146+ - ~~ SQLite support~~
147+
148+ NB: You can find v1 here: https://github.com/mevdschee/php-crud-api/tree/v1
149+
147150## Middleware
148151
149152You can enable the following middleware using the "middlewares" config parameter:
0 commit comments