@@ -71,18 +71,6 @@ These are all the configuration options and their default value between brackets
71
71
- "cacheTime": Number of seconds the cache is valid (` 10 ` )
72
72
- "debug": Show errors in the "X-Debug-Info" header (` false ` )
73
73
74
- ## Compilation
75
-
76
- The code resides in the "` src ` " directory. You can access it at the URL:
77
-
78
- http://localhost:8080/src/records/posts/1
79
-
80
- You can compile all files into a single "` api.php ` " file using:
81
-
82
- php build.php
83
-
84
- NB: The script appends the classes in alphabetical order (directories first).
85
-
86
74
## Limitations
87
75
88
76
These limitation and constrains apply:
@@ -115,34 +103,32 @@ The following features are supported:
115
103
- Spatial/GIS fields and filters supported with WKT
116
104
- Generate API documentation using OpenAPI tools
117
105
- Authentication via JWT token or username/password
106
+ - Support for reading database structure in JSON
107
+ - Support for modifying database structure using REST endpoint
108
+ - Security enhancing middleware is included
109
+ - Standard compliant: PSR-2, PSR-4, PSR-7, PSR-15 and PSR-17
110
+
111
+ ## Compilation
112
+
113
+ You can compile all files into a single "` api.php ` " file using:
118
114
119
- ### Extra Features
115
+ php build.php
116
+
117
+ You can access the non-compiled code at the URL:
118
+
119
+ http://localhost:8080/src/records/posts/1
120
120
121
- These features are new in v2 and were not included in v1:
121
+ The non-compiled code resides in the " ` src ` " and " ` vendor ` " directories.
122
122
123
- - Does not reflect on every request (better performance)
124
- - Complex filters (with both "and" & "or") are supported
125
- - Support for output of database structure in JSON
126
- - Support for boolean and binary data in all database engines
127
- - Support for relational data on read (not only on list operation)
128
- - Support for middleware to modify all operations (also list)
129
- - Error reporting in JSON with corresponding HTTP status
130
- - Support for basic authentication and via auth provider (JWT)
131
- - Support for basic firewall functionality
132
- - Prevent database scraping using list limits
123
+ ### Updating dependencies
133
124
134
- ### Dropped features
125
+ You can update all dependencies of this project using the following command:
135
126
136
- The following features of v1 were dropped in v2:
127
+ php update.php
137
128
138
- - ~~ Streaming data, low memory footprint~~
139
- - ~~ Supports file upload from web forms (multipart/form-data)~~
140
- - ~~ Condensed JSON output: first row contains field names~~
141
- - ~~ Relation "transforms" (of condensed JSON) for PHP and JavaScript~~
142
- - ~~ Unstructured data support through JSON/JSONB~~
143
- - ~~ SQLite support~~
129
+ This script will install and run [ Composer] ( https://getcomposer.org/ ) to update the required dependencies in the "` vendor ` " directory.
144
130
145
- NB: You can find v1 here: https://github.com/mevdschee/php-crud-api/tree/v1
131
+ NB: The update script will also patch the dependencies in the vendor directory for PHP 7.0 compatibility.
146
132
147
133
## Middleware
148
134
@@ -782,7 +768,7 @@ You may use the "customization" middleware to modify request and response and im
782
768
$environment->start = microtime(true);
783
769
},
784
770
'customization.afterHandler' => function ($operation, $tableName, $response, $environment) {
785
- $response->addHeader ('X-Time-Taken', microtime(true) - $environment->start);
771
+ return $response->withHeader ('X-Time-Taken', microtime(true) - $environment->start);
786
772
},
787
773
788
774
The above example will add a header "X-Time-Taken" with the number of seconds the API call has taken.
0 commit comments