From f64b754b6ea0fbc81089a4af0114b906dfb5d21d Mon Sep 17 00:00:00 2001 From: lexx Date: Wed, 8 Nov 2023 14:12:55 +0200 Subject: [PATCH] writer extension --- src/StaticGenerator/Writer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/StaticGenerator/Writer.php b/src/StaticGenerator/Writer.php index 03b0b22..ecf4e08 100644 --- a/src/StaticGenerator/Writer.php +++ b/src/StaticGenerator/Writer.php @@ -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");