CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 5.0 Chiffon API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 5.0
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Form
    • Http
      • Client
      • Cookie
      • Exception
      • Middleware
      • Session
      • TestSuite
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • TestSuite
    • Utility
    • Validation
    • View

Class ResponseEmitter

Emits a Response to the PHP Server API.

Namespace: Cake\Http

Property Summary

  • $maxBufferLength protected
    int

    Maximum output buffering size for each iteration.

Method Summary

  • __construct() public

    Constructor

  • emit() public

    Emit a response.

  • emitBody() protected

    Emit the message body.

  • emitBodyRange() protected

    Emit a range of the message body.

  • emitCookies() protected

    Emit cookies using setcookie()

  • emitHeaders() protected

    Emit response headers.

  • emitStatusLine() protected

    Emit the status line.

  • flush() protected

    Loops through the output buffer, flushing each, before emitting the response.

  • parseContentRange() protected

    Parse content-range header https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16

  • setCookie() protected

    Helper methods to set cookie.

Method Detail

__construct() ¶ public

__construct(int $maxBufferLength = 8192)

Constructor

Parameters
int $maxBufferLength optional

Maximum output buffering size for each iteration.

emit() ¶ public

emit(Psr\Http\Message\ResponseInterface $response): bool

Emit a response.

Emits a response, including status line, headers, and the message body, according to the environment.

Parameters
Psr\Http\Message\ResponseInterface $response

The response to emit.

Returns
bool

emitBody() ¶ protected

emitBody(Psr\Http\Message\ResponseInterface $response): void

Emit the message body.

Parameters
Psr\Http\Message\ResponseInterface $response

The response to emit

Returns
void

emitBodyRange() ¶ protected

emitBodyRange(array $range, Psr\Http\Message\ResponseInterface $response): void

Emit a range of the message body.

Parameters
array $range

The range data to emit

Psr\Http\Message\ResponseInterface $response

The response to emit

Returns
void

emitCookies() ¶ protected

emitCookies(array<Cake\Http\Cookie\CookieInterface|string> $cookies): void

Emit cookies using setcookie()

Parameters
array<Cake\Http\Cookie\CookieInterface|string> $cookies

An array of cookies.

Returns
void

emitHeaders() ¶ protected

emitHeaders(Psr\Http\Message\ResponseInterface $response): void

Emit response headers.

Loops through each header, emitting each; if the header value is an array with multiple values, ensures that each is sent in such a way as to create aggregate headers (instead of replace the previous).

Parameters
Psr\Http\Message\ResponseInterface $response

The response to emit

Returns
void

emitStatusLine() ¶ protected

emitStatusLine(Psr\Http\Message\ResponseInterface $response): void

Emit the status line.

Emits the status line using the protocol version and status code from the response; if a reason phrase is available, it, too, is emitted.

Parameters
Psr\Http\Message\ResponseInterface $response

The response to emit

Returns
void

flush() ¶ protected

flush(int|null $maxBufferLevel = null): void

Loops through the output buffer, flushing each, before emitting the response.

Parameters
int|null $maxBufferLevel optional

Flush up to this buffer level.

Returns
void

parseContentRange() ¶ protected

parseContentRange(string $header): array|false

Parse content-range header https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16

Parameters
string $header

The Content-Range header to parse.

Returns
array|false

setCookie() ¶ protected

setCookie(Cake\Http\Cookie\CookieInterface|string $cookie): bool

Helper methods to set cookie.

Parameters
Cake\Http\Cookie\CookieInterface|string $cookie

Cookie.

Returns
bool

Property Detail

$maxBufferLength ¶ protected

Maximum output buffering size for each iteration.

Type
int
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs