CakePHP
  • 文档
    • 手册
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 徽标和商标
  • 商业解决方案
  • 纪念品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与
    • 问题 (Github)
    • 烘焙坊
    • 精选资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 时事通讯
    • LinkedIn
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助和支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C CakePHP 5.1 Chiffon API

  • 项目
    • CakePHP
      • CakePHP
      • Chronos
      • Elastic Search
      • 队列
  • 版本
    • 5.1
      • 5.1
      • 5.0
      • 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

命名空间

  • 全局
  • 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

类 ResponseEmitter

将响应发送到 PHP 服务器 API。

命名空间: Cake\Http

属性摘要

  • $maxBufferLength protected
    int

    每次迭代的最大输出缓冲区大小。

方法摘要

  • __construct() public

    构造函数

  • emit() public

    发送响应。

  • emitBody() protected

    发送消息主体。

  • emitBodyRange() protected

    发送消息主体的一部分。

  • emitCookies() protected

    使用 setcookie() 发送 Cookie。

  • emitHeaders() protected

    发送响应头。

  • emitStatusLine() protected

    发送状态行。

  • flush() protected

    循环遍历输出缓冲区,逐个刷新,然后再发送响应。

  • parseContentRange() protected

    解析 Content-Range 头 https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16

  • setCookie() protected

    用于设置 Cookie 的辅助方法。

方法详细说明

__construct() ¶ public

__construct(int $maxBufferLength = 8192)

构造函数

参数
int $maxBufferLength 可选

每次迭代的最大输出缓冲区大小。

emit() ¶ public

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

发送响应。

发送响应,包括状态行、头和消息主体,具体取决于环境。

参数
Psr\Http\Message\ResponseInterface $response

要发送的响应。

返回值
bool

emitBody() ¶ protected

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

发送消息主体。

参数
Psr\Http\Message\ResponseInterface $response

要发送的响应

返回值
void

emitBodyRange() ¶ protected

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

发送消息主体的一部分。

参数
array $range

要发送的范围数据

Psr\Http\Message\ResponseInterface $response

要发送的响应

返回值
void

emitCookies() ¶ protected

emitCookies(arrayCake\Http\Cookie\CookieInterface|string> $cookies): void

使用 setcookie() 发送 Cookie。

参数
arrayCake\Http\Cookie\CookieInterface|string> $cookies

Cookie 数组。

返回值
void

emitHeaders() ¶ protected

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

发送响应头。

循环遍历每个头,发送每个头;如果头值为包含多个值的数组,则确保每个头以创建聚合头的方式发送(而不是替换之前的值)。

参数
Psr\Http\Message\ResponseInterface $response

要发送的响应

返回值
void

emitStatusLine() ¶ protected

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

发送状态行。

使用响应中的协议版本和状态码发送状态行;如果有理由短语,则也会发送理由短语。

参数
Psr\Http\Message\ResponseInterface $response

要发送的响应

返回值
void

flush() ¶ protected

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

循环遍历输出缓冲区,逐个刷新,然后再发送响应。

参数
int|null $maxBufferLevel 可选

刷新到该缓冲区级别。

返回值
void

parseContentRange() ¶ protected

parseContentRange(string $header): array|false

解析 Content-Range 头 https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16

参数
string $header

要解析的 Content-Range 头。

返回值
array|false

setCookie() ¶ protected

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

用于设置 Cookie 的辅助方法。

参数
Cake\Http\Cookie\CookieInterface|string $cookie

Cookie。

返回值
bool

属性详细说明

$maxBufferLength ¶ protected

每次迭代的最大输出缓冲区大小。

类型
int
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 手册
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 徽标和商标
  • 社区
  • 参与
  • 问题 (Github)
  • 烘焙坊
  • 精选资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 时事通讯
  • LinkedIn
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成