Skip to content

Commit b8fd419

Browse files
authored
Merge pull request mevdschee#1046 from clysss/bug1044
Bug1044
2 parents 8ac4561 + 3e66725 commit b8fd419

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Tqdev/PhpCrudApi/Api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(Config $config)
6262
$config->getPassword(),
6363
$config->getGeometrySrid()
6464
);
65-
$prefix = sprintf('phpcrudapi-%s-', substr(md5(__FILE__), 0, 8));
65+
$prefix = sprintf('phpcrudapi-%s-', substr($config->getUID()), 0, 8));
6666
$cache = CacheFactory::create($config->getCacheType(), $prefix, $config->getCachePath());
6767
$reflection = new ReflectionService($db, $cache, $config->getCacheTime());
6868
$responder = new JsonResponder($config->getJsonOptions(), $config->getDebug());

src/Tqdev/PhpCrudApi/Config/Config.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ class Config implements ConfigInterface
2929
'openApiBase' => '{"info":{"title":"PHP-CRUD-API","version":"1.0.0"}}',
3030
'geometrySrid' => 4326,
3131
];
32-
32+
33+
public function getUID(): string
34+
{
35+
return md5(json_encode($this->values));
36+
}
37+
3338
private function getDefaultDriver(array $values): string
3439
{
3540
if (isset($values['driver'])) {

0 commit comments

Comments
 (0)