Skip to content

Commit d00c96c

Browse files
committed
update dependencies
1 parent a20d917 commit d00c96c

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

api.include.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ public function createStreamFromResource($resource): StreamInterface
15351535
return Stream::create($resource);
15361536
}
15371537

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
15391539
{
15401540
if (null === $size) {
15411541
$size = $stream->getSize();
@@ -2000,7 +2000,7 @@ class Response implements ResponseInterface
20002000
* @param string $version Protocol version
20012001
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
20022002
*/
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)
20042004
{
20052005
// If we got no body, defer initialization of the stream until Response::getBody()
20062006
if ('' !== $body && null !== $body) {
@@ -4736,7 +4736,12 @@ class Config implements ConfigInterface
47364736
'openApiBase' => '{"info":{"title":"PHP-CRUD-API","version":"1.0.0"}}',
47374737
'geometrySrid' => 4326,
47384738
];
4739-
4739+
4740+
public function getUID(): string
4741+
{
4742+
return md5(json_encode($this->values));
4743+
}
4744+
47404745
private function getDefaultDriver(array $values): string
47414746
{
47424747
if (isset($values['driver'])) {
@@ -12308,7 +12313,7 @@ public function __construct(Config $config)
1230812313
$config->getPassword(),
1230912314
$config->getGeometrySrid()
1231012315
);
12311-
$prefix = sprintf('phpcrudapi-%s-', substr(md5(__FILE__), 0, 8));
12316+
$prefix = sprintf('phpcrudapi-%s-', substr($config->getUID(), 0, 8));
1231212317
$cache = CacheFactory::create($config->getCacheType(), $prefix, $config->getCachePath());
1231312318
$reflection = new ReflectionService($db, $cache, $config->getCacheTime());
1231412319
$responder = new JsonResponder($config->getJsonOptions(), $config->getDebug());

api.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ public function createStreamFromResource($resource): StreamInterface
15351535
return Stream::create($resource);
15361536
}
15371537

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
15391539
{
15401540
if (null === $size) {
15411541
$size = $stream->getSize();
@@ -2000,7 +2000,7 @@ class Response implements ResponseInterface
20002000
* @param string $version Protocol version
20012001
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
20022002
*/
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)
20042004
{
20052005
// If we got no body, defer initialization of the stream until Response::getBody()
20062006
if ('' !== $body && null !== $body) {
@@ -4736,7 +4736,12 @@ class Config implements ConfigInterface
47364736
'openApiBase' => '{"info":{"title":"PHP-CRUD-API","version":"1.0.0"}}',
47374737
'geometrySrid' => 4326,
47384738
];
4739-
4739+
4740+
public function getUID(): string
4741+
{
4742+
return md5(json_encode($this->values));
4743+
}
4744+
47404745
private function getDefaultDriver(array $values): string
47414746
{
47424747
if (isset($values['driver'])) {
@@ -12308,7 +12313,7 @@ public function __construct(Config $config)
1230812313
$config->getPassword(),
1230912314
$config->getGeometrySrid()
1231012315
);
12311-
$prefix = sprintf('phpcrudapi-%s-', substr(md5(__FILE__), 0, 8));
12316+
$prefix = sprintf('phpcrudapi-%s-', substr($config->getUID(), 0, 8));
1231212317
$cache = CacheFactory::create($config->getCacheType(), $prefix, $config->getCachePath());
1231312318
$reflection = new ReflectionService($db, $cache, $config->getCacheTime());
1231412319
$responder = new JsonResponder($config->getJsonOptions(), $config->getDebug());

0 commit comments

Comments
 (0)