diff --git a/php/src/file/tab/AbstractBuilder.php b/php/src/file/tab/AbstractBuilder.php index 65e301f..45c1cd9 100644 --- a/php/src/file/tab/AbstractBuilder.php +++ b/php/src/file/tab/AbstractBuilder.php @@ -122,20 +122,6 @@ abstract class AbstractBuilder extends TempStream implements IBuilder { return $this->index; } - abstract protected function _sendContentType(): void; - - protected bool $sentHeaders = false; - - function sendHeaders(): void { - if ($this->sentHeaders) return; - $this->_sendContentType(); - $output = $this->output; - if ($output !== null) { - http::download_as(path::filename($output)); - } - $this->sentHeaders = true; - } - protected function _build(?iterable $rows=null): void { $this->writeAll($rows); $this->writeHeaders(); @@ -158,6 +144,20 @@ abstract class AbstractBuilder extends TempStream implements IBuilder { return $ok; } + abstract protected function _sendContentType(): void; + + protected bool $sentHeaders = false; + + function sendHeaders(): void { + if ($this->sentHeaders) return; + $this->_sendContentType(); + $output = $this->output; + if ($output !== null) { + http::download_as(path::filename($output)); + } + $this->sentHeaders = true; + } + function sendFile(?iterable $rows=null): int { if (!$this->built) { $this->_build($rows); diff --git a/php/src/file/tab/IBuilder.php b/php/src/file/tab/IBuilder.php index 536b4a6..9817ac0 100644 --- a/php/src/file/tab/IBuilder.php +++ b/php/src/file/tab/IBuilder.php @@ -1,6 +1,8 @@