@@ -1535,7 +1535,7 @@ public function createStreamFromResource($resource): StreamInterface
1535
1535
return Stream::create ($ resource );
1536
1536
}
1537
1537
1538
- public function createUploadedFile (StreamInterface $ stream , int $ size = null , int $ error = \UPLOAD_ERR_OK , string $ clientFilename = null , string $ clientMediaType = null ): UploadedFileInterface
1538
+ public function createUploadedFile (StreamInterface $ stream , ? int $ size = null , int $ error = \UPLOAD_ERR_OK , ? string $ clientFilename = null , ? string $ clientMediaType = null ): UploadedFileInterface
1539
1539
{
1540
1540
if (null === $ size ) {
1541
1541
$ size = $ stream ->getSize ();
@@ -2000,7 +2000,7 @@ class Response implements ResponseInterface
2000
2000
* @param string $version Protocol version
2001
2001
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
2002
2002
*/
2003
- public function __construct (int $ status = 200 , array $ headers = [], $ body = null , string $ version = '1.1 ' , string $ reason = null )
2003
+ public function __construct (int $ status = 200 , array $ headers = [], $ body = null , string $ version = '1.1 ' , ? string $ reason = null )
2004
2004
{
2005
2005
// If we got no body, defer initialization of the stream until Response::getBody()
2006
2006
if ('' !== $ body && null !== $ body ) {
@@ -4736,7 +4736,12 @@ class Config implements ConfigInterface
4736
4736
'openApiBase ' => '{"info":{"title":"PHP-CRUD-API","version":"1.0.0"}} ' ,
4737
4737
'geometrySrid ' => 4326 ,
4738
4738
];
4739
-
4739
+
4740
+ public function getUID (): string
4741
+ {
4742
+ return md5 (json_encode ($ this ->values ));
4743
+ }
4744
+
4740
4745
private function getDefaultDriver (array $ values ): string
4741
4746
{
4742
4747
if (isset ($ values ['driver ' ])) {
@@ -12308,7 +12313,7 @@ public function __construct(Config $config)
12308
12313
$ config ->getPassword (),
12309
12314
$ config ->getGeometrySrid ()
12310
12315
);
12311
- $ prefix = sprintf ('phpcrudapi-%s- ' , substr (md5 ( __FILE__ ), 0 , 8 ));
12316
+ $ prefix = sprintf ('phpcrudapi-%s- ' , substr ($ config -> getUID ( ), 0 , 8 ));
12312
12317
$ cache = CacheFactory::create ($ config ->getCacheType (), $ prefix , $ config ->getCachePath ());
12313
12318
$ reflection = new ReflectionService ($ db , $ cache , $ config ->getCacheTime ());
12314
12319
$ responder = new JsonResponder ($ config ->getJsonOptions (), $ config ->getDebug ());
0 commit comments