Skip to content

Conversation

@markstory
Copy link
Member

@markstory markstory added this to the 5.next milestone Jan 2, 2024
- ``Client`` now emits ``HttpClient.beforeSend`` and ``HttpClient.afterSend``
events when requests are sent. You can use these events to perform logging,
caching or collect telemetry.
- ``Http\Server::terminate()`` was added. This method triggers the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we need to mention that this isn't automatically called and point to the other section you added.

Comment on lines +1074 to +1075
to run logic **after** the response has been sent to the client. Make sure your
application's **webroot/index.php** contains the following::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't write an exact replacement, but think we need to spell out that the changes must be added around the existing emit() call.

New applications created from the app template will include this.


.. warning::
In non fastcgi environments the ``Server.terminate`` event is fired before
the response is sent.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add a warning about the scope of the request object used unless we want to make the modification suggested here: cakephp/cakephp#17514 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just update the example to pull from the container:
cakephp/cakephp#17514 (comment)

@markstory markstory merged commit f85cc6a into 5.next Jan 12, 2024
@markstory markstory deleted the server-terminate branch January 12, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants