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

Public Member Functions

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

Protected Member Functions

 createStream ()
 

Protected Attributes

string $filename
 
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 (   $filename)

Constructor setting up the PHP resource

Parameters
string$filename

Definition at line 42 of file SelfEmittableLazyOpenStream.php.

References TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream\$filename.

Member Function Documentation

◆ createStream()

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

Creates the underlying stream lazily when required.

Definition at line 73 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 51 of file SelfEmittableLazyOpenStream.php.

◆ isWritable()

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

Definition at line 56 of file SelfEmittableLazyOpenStream.php.

◆ write()

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

Definition at line 65 of file SelfEmittableLazyOpenStream.php.

Member Data Documentation

◆ $filename

string TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::$filename
protected

◆ $stream

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

Definition at line 35 of file SelfEmittableLazyOpenStream.php.