diff --git a/src/Helpers/helpers.php b/src/Helpers/helpers.php index a3d6dbe..46843e0 100644 --- a/src/Helpers/helpers.php +++ b/src/Helpers/helpers.php @@ -83,7 +83,13 @@ function a1TempDir(bool $tempFile = false, string $fileExt = '.pfx'): string { $tempDir = dirname(__DIR__) . '/Temp/'; - if ($tempFile) $tempDir .= Str::orderedUuid() . $fileExt; + if (!is_writable($tempDir)) { + $tempDir = sys_get_temp_dir(); + } + + if ($tempFile) { + $tempDir .= Str::orderedUuid() . $fileExt; + } return $tempDir; }