|
@@ -46,10 +46,10 @@ This is a single file application! Upload "api.php" somewhere and enjoy!
|
46
|
46
|
Edit the following lines in the bottom of the file "api.php":
|
47
|
47
|
|
48
|
48
|
```
|
49
|
|
-$api = new MySQL_CRUD_API(array(
|
50
|
|
- 'username'=>'xxx',
|
|
49
|
+$api = new PHP_CRUD_API(array(
|
|
50
|
+ 'username'=>'xxx',
|
51
|
51
|
'password'=>'xxx',
|
52
|
|
- 'database'=>'xxx'
|
|
52
|
+ 'database'=>'xxx',
|
53
|
53
|
));
|
54
|
54
|
$api->executeCommand();
|
55
|
55
|
```
|
|
@@ -57,8 +57,9 @@ $api->executeCommand();
|
57
|
57
|
These are all the configuration options and their default values:
|
58
|
58
|
|
59
|
59
|
```
|
60
|
|
-$api = new MySQL_CRUD_API(array(
|
61
|
|
- 'username=>'root'
|
|
60
|
+$api = new PHP_CRUD_API(array(
|
|
61
|
+ 'dbengine=>'MySQL',
|
|
62
|
+ 'username=>'root',
|
62
|
63
|
'password=>null,
|
63
|
64
|
'database=>false,
|
64
|
65
|
// for connectivity (defaults to localhost):
|
|
@@ -74,8 +75,8 @@ $api = new MySQL_CRUD_API(array(
|
74
|
75
|
'input_sanitizer'=>function($cmd,$db,$tab,$col,$typ,$val) { return $val; },
|
75
|
76
|
'input_validator'=>function($cmd,$db,$tab,$col,$typ,$val,$ctx) { return true; },
|
76
|
77
|
// dependencies (added for unit testing):
|
77
|
|
- 'db'=>null,
|
78
|
|
- 'method'=>$_SERVER['REQUEST_METHOD'],
|
|
78
|
+ 'db'=>null,
|
|
79
|
+ 'method'=>$_SERVER['REQUEST_METHOD'],
|
79
|
80
|
'request'=>$_SERVER['PATH_INFO'],
|
80
|
81
|
'get'=>$_GET,
|
81
|
82
|
'post'=>'php://input',
|
|
@@ -578,7 +579,7 @@ OK (19 tests, 39 assertions)
|
578
|
579
|
$
|
579
|
580
|
```
|
580
|
581
|
|
581
|
|
-NB: You MUST use an empty database as a desctructive database fixture ('blog.mysql') is loaded.
|
|
582
|
+NB: You MUST use an empty database as a desctructive database fixture ('blog_mysql.sql') is loaded.
|
582
|
583
|
|
583
|
584
|
### SQL server on Windows:
|
584
|
585
|
|
|
@@ -594,7 +595,7 @@ OK (19 tests, 39 assertions)
|
594
|
595
|
C:\mysql-crud-api-master>
|
595
|
596
|
```
|
596
|
597
|
|
597
|
|
-NB: You MUST use an empty database as a desctructive database fixture ('blog.mssql') is loaded.
|
|
598
|
+NB: You MUST use an empty database as a desctructive database fixture ('blog_sqlserver.sql') is loaded.
|
598
|
599
|
|
599
|
600
|
### PostgreSQL on Linux
|
600
|
601
|
|
|
@@ -611,7 +612,7 @@ OK (22 tests, 42 assertions)
|
611
|
612
|
$
|
612
|
613
|
```
|
613
|
614
|
|
614
|
|
-NB: You MUST use an empty database as a desctructive database fixture ('blog.pgsql') is loaded.
|
|
615
|
+NB: You MUST use an empty database as a desctructive database fixture ('blog_postgresql.sql') is loaded.
|
615
|
616
|
|
616
|
617
|
## Pretty URL
|
617
|
618
|
|