‪TYPO3CMS  10.4
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 ()
 
bool isWritable ()
 
 write ($string)
 

Protected Attributes

string $filename
 

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 29 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 40 of file SelfEmittableLazyOpenStream.php.

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

Member Function Documentation

◆ 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 49 of file SelfEmittableLazyOpenStream.php.

◆ isWritable()

bool TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream::isWritable ( )
Returns
‪bool

Definition at line 57 of file SelfEmittableLazyOpenStream.php.

◆ write()

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

Definition at line 66 of file SelfEmittableLazyOpenStream.php.

Member Data Documentation

◆ $filename

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