Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • AcceptHeader
  • AcceptHeaderItem
  • ApacheRequest
  • BinaryFileResponse
  • Cookie
  • ExpressionRequestMatcher
  • FileBag
  • HeaderBag
  • IpUtils
  • JsonResponse
  • ParameterBag
  • RedirectResponse
  • Request
  • RequestMatcher
  • RequestStack
  • Response
  • ResponseHeaderBag
  • ServerBag
  • StreamedResponse

Interfaces

  • RequestMatcherInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class StreamedResponse

StreamedResponse represents a streamed HTTP response.

A StreamedResponse uses a callback for its content.

The callback should use the standard PHP functions like echo to stream the response back to the client. The flush() method can also be used if needed.

Symfony\Component\HttpFoundation\Response
Extended by Symfony\Component\HttpFoundation\StreamedResponse
Namespace: Symfony\Component\HttpFoundation
Author: Fabien Potencier fabien@symfony.com
See: flush()
Api
Located at StreamedResponse.php
Methods summary
public
# __construct( callable|null $callback = null, integer $status = 200, array $headers = array() )

Constructor.

Constructor.

Parameters

$callback
A valid PHP callback or null to set it later
$status
The response status code
$headers
An array of response headers

Throws

InvalidArgumentException
When the HTTP status code is not valid

Api

Overrides

Symfony\Component\HttpFoundation\Response::__construct()
public static Symfony\Component\HttpFoundation\StreamedResponse
# create( callable|null $callback = null, integer $status = 200, array $headers = array() )

Factory method for chainability

Factory method for chainability

Parameters

$callback
A valid PHP callback or null to set it later
$status
The response status code
$headers
An array of response headers

Returns

Symfony\Component\HttpFoundation\StreamedResponse

Overrides

Symfony\Component\HttpFoundation\Response::create()
public
# setCallback( callable $callback )

Sets the PHP callback associated with this Response.

Sets the PHP callback associated with this Response.

Parameters

$callback
A valid PHP callback

Throws

LogicException
public Symfony\Component\HttpFoundation\Response
# sendContent( )

Sends content for the current web response.

Sends content for the current web response.

This method only sends the content once.

Returns

Symfony\Component\HttpFoundation\Response

Overrides

Symfony\Component\HttpFoundation\Response::sendContent()
public Symfony\Component\HttpFoundation\Response
# setContent( mixed $content )

Sets the response content.

Sets the response content.

Parameters

$content
Content that can be cast to string

Returns

Symfony\Component\HttpFoundation\Response

Throws

LogicException
when the content is not null

Overrides

Symfony\Component\HttpFoundation\Response::setContent()
public false
# getContent( )

Gets the current response content.

Gets the current response content.

Returns

false

Overrides

Symfony\Component\HttpFoundation\Response::getContent()
Methods inherited from Symfony\Component\HttpFoundation\Response
__clone(), __toString(), closeOutputBuffers(), ensureIEOverSSLCompatibility(), expire(), getAge(), getCharset(), getDate(), getEtag(), getExpires(), getLastModified(), getMaxAge(), getProtocolVersion(), getStatusCode(), getTtl(), getVary(), hasVary(), isCacheable(), isClientError(), isEmpty(), isForbidden(), isFresh(), isInformational(), isInvalid(), isNotFound(), isNotModified(), isOk(), isRedirect(), isRedirection(), isServerError(), isSuccessful(), isValidateable(), mustRevalidate(), prepare(), send(), sendHeaders(), setCache(), setCharset(), setClientTtl(), setDate(), setEtag(), setExpires(), setLastModified(), setMaxAge(), setNotModified(), setPrivate(), setProtocolVersion(), setPublic(), setSharedMaxAge(), setStatusCode(), setTtl(), setVary()
Constants inherited from Symfony\Component\HttpFoundation\Response
HTTP_ACCEPTED, HTTP_ALREADY_REPORTED, HTTP_BAD_GATEWAY, HTTP_BAD_REQUEST, HTTP_CONFLICT, HTTP_CONTINUE, HTTP_CREATED, HTTP_EXPECTATION_FAILED, HTTP_FAILED_DEPENDENCY, HTTP_FORBIDDEN, HTTP_FOUND, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_IM_USED, HTTP_INSUFFICIENT_STORAGE, HTTP_INTERNAL_SERVER_ERROR, HTTP_I_AM_A_TEAPOT, HTTP_LENGTH_REQUIRED, HTTP_LOCKED, HTTP_LOOP_DETECTED, HTTP_METHOD_NOT_ALLOWED, HTTP_MOVED_PERMANENTLY, HTTP_MULTIPLE_CHOICES, HTTP_MULTI_STATUS, HTTP_NETWORK_AUTHENTICATION_REQUIRED, HTTP_NON_AUTHORITATIVE_INFORMATION, HTTP_NOT_ACCEPTABLE, HTTP_NOT_EXTENDED, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_NOT_MODIFIED, HTTP_NO_CONTENT, HTTP_OK, HTTP_PARTIAL_CONTENT, HTTP_PAYMENT_REQUIRED, HTTP_PERMANENTLY_REDIRECT, HTTP_PRECONDITION_FAILED, HTTP_PRECONDITION_REQUIRED, HTTP_PROCESSING, HTTP_PROXY_AUTHENTICATION_REQUIRED, HTTP_REQUESTED_RANGE_NOT_SATISFIABLE, HTTP_REQUEST_ENTITY_TOO_LARGE, HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE, HTTP_REQUEST_TIMEOUT, HTTP_REQUEST_URI_TOO_LONG, HTTP_RESERVED, HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL, HTTP_RESET_CONTENT, HTTP_SEE_OTHER, HTTP_SERVICE_UNAVAILABLE, HTTP_SWITCHING_PROTOCOLS, HTTP_TEMPORARY_REDIRECT, HTTP_TOO_MANY_REQUESTS, HTTP_UNAUTHORIZED, HTTP_UNPROCESSABLE_ENTITY, HTTP_UNSUPPORTED_MEDIA_TYPE, HTTP_UPGRADE_REQUIRED, HTTP_USE_PROXY, HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL, HTTP_VERSION_NOT_SUPPORTED
Properties summary
protected $callback
#
protected $streamed
#
Properties inherited from Symfony\Component\HttpFoundation\Response
$charset, $content, $headers, $statusCode, $statusText, $statusTexts, $version
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen