Skip to content

Commit

Permalink
fix: some naming on historical log names
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybatch committed Apr 4, 2024
1 parent a6a3f68 commit b803faf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/Console/Commands/MvlProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function handle(): int
$targetDir = "storage/app/local";
$sswTargetDir = "ssw://" . $targetDir;

$out_file = $sswTargetDir . "/" . basename($in_file, ".txt") . ".csv";
$out_file = $sswTargetDir . "/" . basename($in_file, ".txt") . ".enc";
$this->info(sprintf("Writing ids to %s", $out_file));

$fh_out = fopen($out_file, 'w');
Expand Down Expand Up @@ -100,6 +100,7 @@ public function handle(): int

$this->info("Total time: " . TextFormatter::secondsToTime(ceil(microtime(true) - $startTime)));
fclose($fh_out);
chmod($out_file, 0644);

stream_wrapper_unregister("ssw");
return 0;
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Store/VoucherController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function listVoucherLogs()

$directoryPath = storage_path("app/local"); # I think I'm using the wrong function to access files?
$logFiles = File::glob($directoryPath . '/*.arcx.csv');
$logFiles = File::glob($directoryPath . '/*.enc');

$downloadLinks = [];
$logMetadata = [];
Expand Down Expand Up @@ -200,7 +200,7 @@ public function downloadAndDecryptVoucherLogs(Request $request)
echo $message;
} while (!$eof); // While there is more to do, continue.
}, 200, [
'Content-Disposition' => 'attachment; filename="' . $logFile . '"'
'Content-Disposition' => 'attachment; filename="' . str_replace(".enc", "", $logFile) . '"'
]);

}
Expand Down

0 comments on commit b803faf

Please sign in to comment.