mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +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();
|
$tmpDir = sys_get_temp_dir();
|
||||||
$keyPath = $tmpDir . '/' . sha1($key) . '.key';
|
$keyPath = $tmpDir . '/' . sha1($key) . '.key';
|
||||||
|
|
||||||
if (!file_exists($keyPath) && !touch($keyPath)) {
|
if (file_exists($keyPath)) {
|
||||||
|
return 'file://' . $keyPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!touch($keyPath)) {
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
throw new \RuntimeException(sprintf('"%s" key file could not be created', $keyPath));
|
throw new \RuntimeException(sprintf('"%s" key file could not be created', $keyPath));
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
Loading…
Reference in New Issue
Block a user