mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 08:23:03 +05:30
Merge pull request #845 from kpn13/master
Do not create key file if it already exists and it is the same
This commit is contained in:
commit
3999c41fef
@ -73,7 +73,11 @@ class CryptKey
|
||||
$tmpDir = sys_get_temp_dir();
|
||||
$keyPath = $tmpDir . '/' . sha1($key) . '.key';
|
||||
|
||||
if (!file_exists($keyPath) && !touch($keyPath)) {
|
||||
if (file_exists($keyPath)) {
|
||||
return 'file://' . $keyPath;
|
||||
}
|
||||
|
||||
if (!touch($keyPath)) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \RuntimeException(sprintf('"%s" key file could not be created', $keyPath));
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
Loading…
Reference in New Issue
Block a user