Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Removes Content-Length injection and output buffer flushing #270

Merged
merged 4 commits into from
Sep 13, 2017

Commits on Sep 11, 2017

  1. Removes output buffer awareness from Server, emitters

    By removing a call to `ob_start()` within `Server::listen()`, we can
    solve the issue of detecting when we have both a response and content in
    the output buffer; in most cases, we will have already sent headers,
    which will cause an exception to be raised; we can also check the
    _current_ output buffer and, if non-empty, raise an exception.
    
    This means we can:
    
    - Remove the `SapiEmitterTrait::flush()` implementation, and all calls
      to it.
    - Remove the `$maxBufferLevel` argument to each emitter.
    - Remove tests regarding interactions of emitters with the output buffer.
    
    This is a backwards-incompatible change. However, it fixes a rather
    tricky problem that occurs currently when mixing buffered output and
    response instances.
    weierophinney committed Sep 11, 2017
    Configuration menu
    Copy the full SHA
    ba5b16e View commit details
    Browse the repository at this point in the history
  2. Removes Content-Length injection from SAPI stream emitters

    Per zendframework#251, this patch removes Content-Length injection from SAPI stream
    emitters. It also renames the `checkForPreviousOutput()` method to
    `assertNoPreviousOutput()` to make it more clear that the method is a
    no-op under proper usage.
    
    The `assertNoPreviousOutput()` method also borrows an idea from the
    comment to the issue, indicating we can check for (1) a non-zero output
    buffer, and (2) use `ob_get_length()` to determine if it has content.
    weierophinney committed Sep 11, 2017
    Configuration menu
    Copy the full SHA
    0725467 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    755ded6 View commit details
    Browse the repository at this point in the history
  4. Updates documentation of emitters

    - Ensures they do not discuss output buffering.
    - Adds section on `SapiStreamEmitter`.
    weierophinney committed Sep 11, 2017
    Configuration menu
    Copy the full SHA
    a22b273 View commit details
    Browse the repository at this point in the history