|
@@ -21,6 +21,8 @@ Related projects:
|
21
|
21
|
|
22
|
22
|
This is a single file application! Upload "api.php" somewhere and enjoy!
|
23
|
23
|
|
|
24
|
+Alternatively, you can use [Composer](https://getcomposer.org/). See the _Composer Installation_ section below.
|
|
25
|
+
|
24
|
26
|
## Limitations
|
25
|
27
|
|
26
|
28
|
- Primary keys should either be auto-increment (from 1 to 2^53) or UUID
|
|
@@ -1028,6 +1030,39 @@ string(6) "/posts"
|
1028
|
1030
|
|
1029
|
1031
|
If it does not, something is wrong on your hosting environment.
|
1030
|
1032
|
|
|
1033
|
+## Composer Installation
|
|
1034
|
+
|
|
1035
|
+- Include the library in your composer.json file:
|
|
1036
|
+
|
|
1037
|
+```json
|
|
1038
|
+{
|
|
1039
|
+ "require": {
|
|
1040
|
+ "mevdschee/php-crud-api": "dev-master"
|
|
1041
|
+ }
|
|
1042
|
+}
|
|
1043
|
+```
|
|
1044
|
+
|
|
1045
|
+- Run `composer install`
|
|
1046
|
+- Use the library in your own code:
|
|
1047
|
+
|
|
1048
|
+```php
|
|
1049
|
+<?php
|
|
1050
|
+
|
|
1051
|
+include './vendor/autoload.php';
|
|
1052
|
+
|
|
1053
|
+// DB Connection
|
|
1054
|
+$api = new PHP_CRUD_API(array(
|
|
1055
|
+ 'dbengine'=>'MySQL',
|
|
1056
|
+ 'hostname'=>'localhost',
|
|
1057
|
+ 'username'=>'',
|
|
1058
|
+ 'password'=>'',
|
|
1059
|
+ 'database'=>'',
|
|
1060
|
+ 'charset'=>'utf8'
|
|
1061
|
+));
|
|
1062
|
+$api->executeCommand();
|
|
1063
|
+
|
|
1064
|
+```
|
|
1065
|
+
|
1031
|
1066
|
## License
|
1032
|
1067
|
|
1033
|
1068
|
MIT
|