Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git
pages/RawPage.php
class RawPage implements Page {
- private $git;
- private $hash;
+ private Git $git;
+ private string $hash;
- public function __construct( $git, $hash ) {
+ public function __construct( Git $git, string $hash ) {
$this->git = $git;
$this->hash = $hash;
}
- public function render() {
+ public function render(): void {
$name = $_GET['name'] ?? '';
$file = $this->git->readFile( $this->hash, $name );
- while( ob_get_level() ) {
- ob_end_clean();
+ while( ob_get_level() > 0 ) {
+ if( !ob_end_clean() ) {
+ break;
+ }
}
$file->emitRawHeaders();
- $this->git->stream( $this->hash, function( $d ) {
- echo $d;
- }, $name );
+
+ $this->git->stream(
+ $this->hash,
+ function( string $data ): void {
+ echo $data;
+ },
+ $name
+ );
exit;

Terminates flush early

Author Dave Jarvis <email>
Date 2026-02-21 20:42:32 GMT-0800
Commit 1d5eebefffb79631002ebcb11a44ffef4baede49
Parent 615160a
Delta 16 lines added, 9 lines removed, 7-line increase