writer extension

This commit is contained in:
2023-11-08 14:12:55 +02:00
parent 834715d773
commit f64b754b6e
+3 -3
View File
@@ -19,10 +19,9 @@ class Writer
return storage_path("lucent/build/" . ltrim($path, "/"));
}
public function save(string $path, string $html): void
public function save(string $path, string $html, string $extension = "html"): void
{
$filepath = $this->buildPath($path. "/index.html");
$filepath = $this->buildPath($path. "/index.$extension");
if (!file_exists(pathinfo($filepath, PATHINFO_DIRNAME))) {
make_dir_r(pathinfo($filepath, PATHINFO_DIRNAME));
@@ -32,6 +31,7 @@ class Writer
}
public function recordIterator(callable $query, callable $parser, int $skip = 0, $limit = 100): int
{
// logger("fetching $skip");