Skip to content

Commit

Permalink
Merge pull request #130 from lsnepomuceno/feat/adds-sys-temp-dir
Browse files Browse the repository at this point in the history
feat: adds support for system temp dir
  • Loading branch information
lsnepomuceno authored Jan 19, 2024
2 parents 257c1f8 + 8be92da commit 13e9081
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Helpers/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 13e9081

Please sign in to comment.