PHP Class eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse

Inheritance: extends Symfony\Component\HttpFoundation\Response
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$file eZ\Publish\Core\IO\Values\BinaryFile
$ioService eZ\Publish\Core\IO\IOServiceInterface
$maxlen
$offset
$trustXSendfileTypeHeader

Public Methods

Method Description
__construct ( BinaryFile $binaryFile, eZ\Publish\Core\IO\IOServiceInterface $ioService, integer $status = 200, array $headers = [], boolean $public = true, null | string $contentDisposition = null, boolean $autoLastModified = true ) Constructor.
getContent ( )
getFile ( ) : BinaryFile Gets the file.
prepare ( Request $request )
sendContent ( ) Sends the file.
setAutoLastModified ( ) Automatically sets the Last-Modified header according the file modification date.
setContent ( $content )
setContentDisposition ( string $disposition, string $filename = '', string $filenameFallback = '' ) : BinaryStreamResponse Sets the Content-Disposition header with the given filename.
setFile ( SplFileInfo | string $file, string $contentDisposition = null, boolean $autoLastModified = true ) : BinaryFileResponse Sets the file to stream.

Method Details

__construct() public method

Constructor.
public __construct ( BinaryFile $binaryFile, eZ\Publish\Core\IO\IOServiceInterface $ioService, integer $status = 200, array $headers = [], boolean $public = true, null | string $contentDisposition = null, boolean $autoLastModified = true )
$binaryFile eZ\Publish\Core\IO\Values\BinaryFile The name of the file to stream
$ioService eZ\Publish\Core\IO\IOServiceInterface The name of the file to stream
$status integer The response status code
$headers array An array of response headers
$public boolean Files are public by default
$contentDisposition null | string The type of Content-Disposition to set automatically with the filename
$autoLastModified boolean Whether the Last-Modified header should be automatically set

getContent() public method

public getContent ( )

getFile() public method

Gets the file.
public getFile ( ) : BinaryFile
return eZ\Publish\Core\IO\Values\BinaryFile The file to stream

prepare() public method

public prepare ( Request $request )
$request Symfony\Component\HttpFoundation\Request

sendContent() public method

Sends the file.
public sendContent ( )

setAutoLastModified() public method

Automatically sets the Last-Modified header according the file modification date.
public setAutoLastModified ( )

setContent() public method

public setContent ( $content )

setContentDisposition() public method

Sets the Content-Disposition header with the given filename.
public setContentDisposition ( string $disposition, string $filename = '', string $filenameFallback = '' ) : BinaryStreamResponse
$disposition string ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
$filename string Optionally use this filename instead of the real name of the file
$filenameFallback string A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
return BinaryStreamResponse

setFile() public method

Sets the file to stream.
public setFile ( SplFileInfo | string $file, string $contentDisposition = null, boolean $autoLastModified = true ) : BinaryFileResponse
$file SplFileInfo | string The file to stream
$contentDisposition string
$autoLastModified boolean
return Symfony\Component\HttpFoundation\BinaryFileResponse

Property Details

$file protected property

protected BinaryFile,eZ\Publish\Core\IO\Values $file
return eZ\Publish\Core\IO\Values\BinaryFile

$ioService protected property

protected IOServiceInterface,eZ\Publish\Core\IO $ioService
return eZ\Publish\Core\IO\IOServiceInterface

$maxlen protected property

protected $maxlen

$offset protected property

protected $offset

$trustXSendfileTypeHeader protected static property

protected static $trustXSendfileTypeHeader