Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse Class Reference

A modified version of HttpFoundation's BinaryFileResponse that accepts a stream as the input. More...

Inheritance diagram for eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse:

## Public Member Functions
| __construct (BinaryFile $binaryFile, IOServiceInterface $ioService, $status=200, $headers=[], $public=true, $contentDisposition=null, $autoLastModified=true)
| Constructor. More...
| setFile ($file, $contentDisposition=null, $autoLastModified=true)
| Sets the file to stream. More...
| getFile ()
| Gets the file. More...
| setAutoLastModified ()
| Automatically sets the Last-Modified header according the file modification date. More...
| setContentDisposition ($disposition, $filename='', $filenameFallback='')
| Sets the Content-Disposition header with the given filename. More...
| prepare (Request $request)
| {} More...
| sendContent ()
| Sends the file. More...
| setContent ($content)
| {} More...
| getContent ()

## Protected Attributes
| $file
| $ioService
| $offset
| $maxlen

## Static Protected Attributes
static | $trustXSendfileTypeHeader = false

## Detailed Description

A modified version of HttpFoundation's BinaryFileResponse that accepts a stream as the input.

Definition at line 20 of file BinaryStreamResponse.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::__construct | ( | BinaryFile | $binaryFile,
|  | IOServiceInterface | $ioService,
|  |  | $status = `200`,
|  |  | $headers = `[]`,
|  |  | $public = `true`,
|  |  | $contentDisposition = `null`,
|  |  | $autoLastModified = `true`
| ) |  |

Constructor.

Parameters

  BinaryFile | $binaryFile | The name of the file to stream
  IOServiceInterface | $ioService | The name of the file to stream
  int | $status | The response status code
  array | $headers | An array of response headers
  bool | $public | Files are public by default
  string | null | $contentDisposition | The type of Content-Disposition to set automatically with the filename
  bool | $autoEtag | Whether the ETag header should be automatically set
  bool | $autoLastModified | Whether the Last-Modified header should be automatically set

Definition at line 46 of file BinaryStreamResponse.php.

References eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\$ioService, and eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\setFile().

## Member Function Documentation

## ◆ getContent()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::getContent | ( |  | ) |

Definition at line 223 of file BinaryStreamResponse.php.

## ◆ getFile()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::getFile | ( |  | ) |

Gets the file.

Returns
  BinaryFile The file to stream

Definition at line 89 of file BinaryStreamResponse.php.

References eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\$file.

## ◆ prepare()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::prepare | ( | Request | $request | ) |

{}

Definition at line 132 of file BinaryStreamResponse.php.

## ◆ sendContent()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::sendContent | ( |  | ) |

Sends the file.

Definition at line 192 of file BinaryStreamResponse.php.

## ◆ setAutoLastModified()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::setAutoLastModified | ( |  | ) |

Automatically sets the Last-Modified header according the file modification date.

Definition at line 97 of file BinaryStreamResponse.php.

Referenced by eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\setFile().

## ◆ setContent()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::setContent | ( |  | $content | ) |

{}

Exceptions

  LogicException | when the content is not null

Definition at line 216 of file BinaryStreamResponse.php.

## ◆ setContentDisposition()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::setContentDisposition | ( |  | $disposition,
|  |  | $filename = `''`,
|  |  | $filenameFallback = `''`
| ) |  |

Sets the Content-Disposition header with the given filename.

Parameters

  string | $disposition | ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
  string | $filename | Optionally use this filename instead of the real name of the file
  string | $filenameFallback | A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename

Returns
  BinaryStreamResponse

Definition at line 113 of file BinaryStreamResponse.php.

Referenced by eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\setFile().

## ◆ setFile()

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::setFile | ( |  | $file,
|  |  | $contentDisposition = `null`,
|  |  | $autoLastModified = `true`
| ) |  |

Sets the file to stream.

Parameters

  \SplFileInfo | string | $file | The file to stream
  string | $contentDisposition |
  bool | $autoEtag |
  bool | $autoLastModified |

Returns
  BinaryFileResponse

Definition at line 69 of file BinaryStreamResponse.php.

References eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\$file, eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\setAutoLastModified(), and eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\setContentDisposition().

Referenced by eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\__construct().

## Member Data Documentation

## ◆ $file

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::$file
| protected

Definition at line 25 of file BinaryStreamResponse.php.

Referenced by eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\getFile(), and eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\setFile().

## ◆ $ioService

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::$ioService
| protected

Definition at line 28 of file BinaryStreamResponse.php.

Referenced by eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse\__construct().

## ◆ $maxlen

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::$maxlen
| protected

Definition at line 32 of file BinaryStreamResponse.php.

## ◆ $offset

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::$offset
| protected

Definition at line 30 of file BinaryStreamResponse.php.

## ◆ $trustXSendfileTypeHeader

eZ\Bundle\EzPublishIOBundle\BinaryStreamResponse::$trustXSendfileTypeHeader = false
| static protected

Definition at line 22 of file BinaryStreamResponse.php.

The documentation for this class was generated from the following file:

- BinaryStreamResponse.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.