7
7
8
8
namespace Tqdev \PhpCrudApi ;
9
9
10
- // file: src/Psr/Http/Message/MessageInterface.php
10
+ // file: vendor/psr/http-factory/src/RequestFactoryInterface.php
11
+
12
+ interface RequestFactoryInterface
13
+ {
14
+
15
+ public function createRequest (string $ method , $ uri ): RequestInterface ;
16
+ }
17
+
18
+ // file: vendor/psr/http-factory/src/ResponseFactoryInterface.php
19
+
20
+ interface ResponseFactoryInterface
21
+ {
22
+
23
+ public function createResponse (int $ code = 200 , string $ reasonPhrase = '' ): ResponseInterface ;
24
+ }
25
+
26
+ // file: vendor/psr/http-factory/src/ServerRequestFactoryInterface.php
27
+
28
+ interface ServerRequestFactoryInterface
29
+ {
30
+
31
+ public function createServerRequest (string $ method , $ uri , array $ serverParams = []): ServerRequestInterface ;
32
+ }
33
+
34
+ // file: vendor/psr/http-factory/src/StreamFactoryInterface.php
35
+
36
+ interface StreamFactoryInterface
37
+ {
38
+
39
+ public function createStream (string $ content = '' ): StreamInterface ;
40
+
41
+ public function createStreamFromFile (string $ filename , string $ mode = 'r ' ): StreamInterface ;
42
+
43
+ public function createStreamFromResource ($ resource ): StreamInterface ;
44
+ }
45
+
46
+ // file: vendor/psr/http-factory/src/UploadedFileFactoryInterface.php
47
+
48
+ interface UploadedFileFactoryInterface
49
+ {
50
+
51
+ public function createUploadedFile (
52
+ StreamInterface $ stream ,
53
+ int $ size = null ,
54
+ int $ error = \UPLOAD_ERR_OK ,
55
+ string $ clientFilename = null ,
56
+ string $ clientMediaType = null
57
+ ): UploadedFileInterface ;
58
+ }
59
+
60
+ // file: vendor/psr/http-factory/src/UriFactoryInterface.php
61
+
62
+ interface UriFactoryInterface
63
+ {
64
+
65
+ public function createUri (string $ uri = '' ): UriInterface ;
66
+ }
67
+
68
+ // file: vendor/psr/http-message/src/MessageInterface.php
11
69
12
70
interface MessageInterface
13
71
{
@@ -35,15 +93,7 @@ public function getBody();
35
93
public function withBody (StreamInterface $ body );
36
94
}
37
95
38
- // file: src/Psr/Http/Message/RequestFactoryInterface.php
39
-
40
- interface RequestFactoryInterface
41
- {
42
-
43
- public function createRequest (string $ method , $ uri ): RequestInterface ;
44
- }
45
-
46
- // file: src/Psr/Http/Message/RequestInterface.php
96
+ // file: vendor/psr/http-message/src/RequestInterface.php
47
97
48
98
interface RequestInterface extends MessageInterface
49
99
{
@@ -61,15 +111,7 @@ public function getUri();
61
111
public function withUri (UriInterface $ uri , $ preserveHost = false );
62
112
}
63
113
64
- // file: src/Psr/Http/Message/ResponseFactoryInterface.php
65
-
66
- interface ResponseFactoryInterface
67
- {
68
-
69
- public function createResponse (int $ code = 200 , string $ reasonPhrase = '' ): ResponseInterface ;
70
- }
71
-
72
- // file: src/Psr/Http/Message/ResponseInterface.php
114
+ // file: vendor/psr/http-message/src/ResponseInterface.php
73
115
74
116
interface ResponseInterface extends MessageInterface
75
117
{
@@ -81,15 +123,7 @@ public function withStatus($code, $reasonPhrase = '');
81
123
public function getReasonPhrase ();
82
124
}
83
125
84
- // file: src/Psr/Http/Message/ServerRequestFactoryInterface.php
85
-
86
- interface ServerRequestFactoryInterface
87
- {
88
-
89
- public function createServerRequest (string $ method , $ uri , array $ serverParams = []): ServerRequestInterface ;
90
- }
91
-
92
- // file: src/Psr/Http/Message/ServerRequestInterface.php
126
+ // file: vendor/psr/http-message/src/ServerRequestInterface.php
93
127
94
128
interface ServerRequestInterface extends RequestInterface
95
129
{
@@ -121,19 +155,7 @@ public function withAttribute($name, $value);
121
155
public function withoutAttribute ($ name );
122
156
}
123
157
124
- // file: src/Psr/Http/Message/StreamFactoryInterface.php
125
-
126
- interface StreamFactoryInterface
127
- {
128
-
129
- public function createStream (string $ content = '' ): StreamInterface ;
130
-
131
- public function createStreamFromFile (string $ filename , string $ mode = 'r ' ): StreamInterface ;
132
-
133
- public function createStreamFromResource ($ resource ): StreamInterface ;
134
- }
135
-
136
- // file: src/Psr/Http/Message/StreamInterface.php
158
+ // file: vendor/psr/http-message/src/StreamInterface.php
137
159
138
160
interface StreamInterface
139
161
{
@@ -169,21 +191,7 @@ public function getContents();
169
191
public function getMetadata ($ key = null );
170
192
}
171
193
172
- // file: src/Psr/Http/Message/UploadedFileFactoryInterface.php
173
-
174
- interface UploadedFileFactoryInterface
175
- {
176
-
177
- public function createUploadedFile (
178
- StreamInterface $ stream ,
179
- int $ size = null ,
180
- int $ error = \UPLOAD_ERR_OK ,
181
- string $ clientFilename = null ,
182
- string $ clientMediaType = null
183
- ): UploadedFileInterface ;
184
- }
185
-
186
- // file: src/Psr/Http/Message/UploadedFileInterface.php
194
+ // file: vendor/psr/http-message/src/UploadedFileInterface.php
187
195
188
196
interface UploadedFileInterface
189
197
{
@@ -201,15 +209,7 @@ public function getClientFilename();
201
209
public function getClientMediaType ();
202
210
}
203
211
204
- // file: src/Psr/Http/Message/UriFactoryInterface.php
205
-
206
- interface UriFactoryInterface
207
- {
208
-
209
- public function createUri (string $ uri = '' ): UriInterface ;
210
- }
211
-
212
- // file: src/Psr/Http/Message/UriInterface.php
212
+ // file: vendor/psr/http-message/src/UriInterface.php
213
213
214
214
interface UriInterface
215
215
{
@@ -247,23 +247,23 @@ public function withFragment($fragment);
247
247
public function __toString ();
248
248
}
249
249
250
- // file: src/Psr/Http/Server/MiddlewareInterface .php
250
+ // file: vendor/psr/http-server-handler/src/RequestHandlerInterface .php
251
251
252
- interface MiddlewareInterface
252
+ interface RequestHandlerInterface
253
253
{
254
254
255
- public function process (ServerRequestInterface $ request, RequestHandlerInterface $ handler ): ResponseInterface ;
255
+ public function handle (ServerRequestInterface $ request ): ResponseInterface ;
256
256
}
257
257
258
- // file: src/Psr/Http/Server/RequestHandlerInterface .php
258
+ // file: vendor/psr/http-server-middleware/src/MiddlewareInterface .php
259
259
260
- interface RequestHandlerInterface
260
+ interface MiddlewareInterface
261
261
{
262
262
263
- public function handle (ServerRequestInterface $ request ): ResponseInterface ;
263
+ public function process (ServerRequestInterface $ request, RequestHandlerInterface $ handler ): ResponseInterface ;
264
264
}
265
265
266
- // file: src/Nyholm/Psr7 /Factory/Psr17Factory.php
266
+ // file: vendor/nyholm/psr7/src /Factory/Psr17Factory.php
267
267
268
268
final class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface
269
269
{
@@ -321,7 +321,7 @@ public function createServerRequest(string $method, $uri, array $serverParams =
321
321
}
322
322
}
323
323
324
- // file: src/Nyholm/Psr7 /MessageTrait.php
324
+ // file: vendor/nyholm/psr7/src /MessageTrait.php
325
325
326
326
trait MessageTrait
327
327
{
@@ -486,7 +486,7 @@ private function validateAndTrimHeader($header, $values): array
486
486
}
487
487
}
488
488
489
- // file: src/Nyholm/Psr7 /Request.php
489
+ // file: vendor/nyholm/psr7/src /Request.php
490
490
491
491
final class Request implements RequestInterface
492
492
{
@@ -514,7 +514,7 @@ public function __construct(string $method, $uri, array $headers = [], $body = n
514
514
}
515
515
}
516
516
517
- // file: src/Nyholm/Psr7 /RequestTrait.php
517
+ // file: vendor/nyholm/psr7/src /RequestTrait.php
518
518
519
519
trait RequestTrait
520
520
{
@@ -611,7 +611,7 @@ private function updateHostFromUri(): void
611
611
}
612
612
}
613
613
614
- // file: src/Nyholm/Psr7 /Response.php
614
+ // file: vendor/nyholm/psr7/src /Response.php
615
615
616
616
final class Response implements ResponseInterface
617
617
{
@@ -678,7 +678,7 @@ public function withStatus($code, $reasonPhrase = ''): self
678
678
}
679
679
}
680
680
681
- // file: src/Nyholm/Psr7 /ServerRequest.php
681
+ // file: vendor/nyholm/psr7/src /ServerRequest.php
682
682
683
683
final class ServerRequest implements ServerRequestInterface
684
684
{
@@ -815,7 +815,7 @@ public function withoutAttribute($attribute): self
815
815
}
816
816
}
817
817
818
- // file: src/Nyholm/Psr7 /Stream.php
818
+ // file: vendor/nyholm/psr7/src /Stream.php
819
819
820
820
final class Stream implements StreamInterface
821
821
{
@@ -1042,7 +1042,7 @@ public function getMetadata($key = null)
1042
1042
}
1043
1043
}
1044
1044
1045
- // file: src/Nyholm/Psr7 /UploadedFile.php
1045
+ // file: vendor/nyholm/psr7/src /UploadedFile.php
1046
1046
1047
1047
final class UploadedFile implements UploadedFileInterface
1048
1048
{
@@ -1184,7 +1184,7 @@ public function getClientMediaType(): ?string
1184
1184
}
1185
1185
}
1186
1186
1187
- // file: src/Nyholm/Psr7 /Uri.php
1187
+ // file: vendor/nyholm/psr7/src /Uri.php
1188
1188
1189
1189
final class Uri implements UriInterface
1190
1190
{
@@ -1463,7 +1463,7 @@ private static function rawurlencodeMatchZero(array $match): string
1463
1463
}
1464
1464
}
1465
1465
1466
- // file: src/Nyholm/Psr7Server /ServerRequestCreator.php
1466
+ // file: vendor/nyholm/psr7-server/src /ServerRequestCreator.php
1467
1467
1468
1468
final class ServerRequestCreator implements ServerRequestCreatorInterface
1469
1469
{
@@ -1496,7 +1496,7 @@ public function fromGlobals(): ServerRequestInterface
1496
1496
1497
1497
$ headers = \function_exists ('getallheaders ' ) ? getallheaders () : static ::getHeadersFromServer ($ _SERVER );
1498
1498
1499
- return $ this ->fromArrays ($ server , $ headers , $ _COOKIE , $ _GET , $ _POST , $ _FILES , \ fopen ('php://input ' , 'r ' ) ?: null );
1499
+ return $ this ->fromArrays ($ server , $ headers , $ _COOKIE , $ _GET , $ _POST , $ _FILES , fopen ('php://input ' , 'r ' ) ?: null );
1500
1500
}
1501
1501
1502
1502
public function fromArrays (array $ server , array $ headers = [], array $ cookie = [], array $ get = [], array $ post = [], array $ files = [], $ body = null ): ServerRequestInterface
@@ -1649,20 +1649,16 @@ private function createUriFromArray(array $server): UriInterface
1649
1649
$ uri = $ uri ->withScheme ('on ' === $ server ['HTTPS ' ] ? 'https ' : 'http ' );
1650
1650
}
1651
1651
1652
- if (isset ($ server ['SERVER_PORT ' ])) {
1653
- $ uri = $ uri ->withPort ($ server ['SERVER_PORT ' ]);
1654
- }
1655
-
1656
1652
if (isset ($ server ['HTTP_HOST ' ])) {
1657
- if (1 === \preg_match ('/^(.+)\:(\d+)$/ ' , $ server ['HTTP_HOST ' ], $ matches )) {
1658
- $ uri = $ uri ->withHost ($ matches [1 ])->withPort ($ matches [2 ]);
1659
- } else {
1660
- $ uri = $ uri ->withHost ($ server ['HTTP_HOST ' ]);
1661
- }
1653
+ $ uri = $ uri ->withHost ($ server ['HTTP_HOST ' ]);
1662
1654
} elseif (isset ($ server ['SERVER_NAME ' ])) {
1663
1655
$ uri = $ uri ->withHost ($ server ['SERVER_NAME ' ]);
1664
1656
}
1665
1657
1658
+ if (isset ($ server ['SERVER_PORT ' ])) {
1659
+ $ uri = $ uri ->withPort ($ server ['SERVER_PORT ' ]);
1660
+ }
1661
+
1666
1662
if (isset ($ server ['REQUEST_URI ' ])) {
1667
1663
$ uri = $ uri ->withPath (\current (\explode ('? ' , $ server ['REQUEST_URI ' ])));
1668
1664
}
@@ -1675,7 +1671,7 @@ private function createUriFromArray(array $server): UriInterface
1675
1671
}
1676
1672
}
1677
1673
1678
- // file: src/Nyholm/Psr7Server /ServerRequestCreatorInterface.php
1674
+ // file: vendor/nyholm/psr7-server/src /ServerRequestCreatorInterface.php
1679
1675
1680
1676
interface ServerRequestCreatorInterface
1681
1677
{
@@ -3466,7 +3462,7 @@ class GenericDB
3466
3462
private $ columns ;
3467
3463
private $ converter ;
3468
3464
3469
- private function getDsn (string $ address , string $ port , string $ database ): string
3465
+ private function getDsn (string $ address , int $ port , string $ database ): string
3470
3466
{
3471
3467
switch ($ this ->driver ) {
3472
3468
case 'mysql ' :return "$ this ->driver :host= $ address;port= $ port;dbname= $ database;charset=utf8mb4 " ;
@@ -3514,7 +3510,7 @@ private function getOptions(): array
3514
3510
}
3515
3511
}
3516
3512
3517
- public function __construct (string $ driver , string $ address , string $ port , string $ database , string $ username , string $ password )
3513
+ public function __construct (string $ driver , string $ address , int $ port , string $ database , string $ username , string $ password )
3518
3514
{
3519
3515
$ this ->driver = $ driver ;
3520
3516
$ this ->database = $ database ;
0 commit comments