‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream Class Reference
Inheritance diagram for TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream:

Public Member Functions

 __construct (protected readonly string $filename)
 emit ()
 isWritable ()
 write (string $string)

Protected Member Functions

 createStream ()

Protected Attributes

readonly LazyOpenStream $stream

Detailed Description

This class implements a stream that can be used like a usual PSR-7 stream but is additionally able to provide a file-serving fastpath using readfile(). The file this stream refers to is opened on demand.

Definition at line 31 of file SelfEmittableLazyOpenStream.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::__construct ( protected readonly string  $filename)

Constructor setting up the PHP resource

Definition at line 40 of file SelfEmittableLazyOpenStream.php.

Member Function Documentation

◆ createStream()

TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::createStream ( )

Creates the underlying stream lazily when required.

Definition at line 69 of file SelfEmittableLazyOpenStream.php.

◆ emit()

TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::emit ( )

Output the contents of the file to the output buffer

Implements TYPO3\CMS\Core\Http\SelfEmittableStreamInterface.

Definition at line 48 of file SelfEmittableLazyOpenStream.php.

◆ isWritable()

TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::isWritable ( )

Definition at line 53 of file SelfEmittableLazyOpenStream.php.

◆ write()

TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::write ( string  $string)

Definition at line 61 of file SelfEmittableLazyOpenStream.php.

Member Data Documentation

◆ $stream

readonly LazyOpenStream TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::$stream

Definition at line 35 of file SelfEmittableLazyOpenStream.php.