Skip to content

Request hook#5433

Open
jrauh01 wants to merge 6 commits intomainfrom
request-hook
Open

Request hook#5433
jrauh01 wants to merge 6 commits intomainfrom
request-hook

Conversation

@jrauh01
Copy link
Contributor

@jrauh01 jrauh01 commented Oct 10, 2025

Add a RequestHook that hooks into different states of a request. The implementation starts with hooking into after non xhr requests are dispatched. This is meant to be extended for more more states like for example before a request gets dispatched.

@jrauh01 jrauh01 self-assigned this Oct 10, 2025
@cla-bot cla-bot bot added the cla/signed label Oct 10, 2025
@jrauh01 jrauh01 requested a review from lippserd October 10, 2025 07:30
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

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

@lippserd, what do you think about the following?

@jrauh01 jrauh01 marked this pull request as draft November 6, 2025 10:48
@jrauh01 jrauh01 marked this pull request as ready for review November 6, 2025 11:45
@jrauh01 jrauh01 force-pushed the request-hook branch 2 times, most recently from c98fc25 to 69a3cba Compare November 17, 2025 11:55
@Al2Klimov Al2Klimov self-requested a review February 16, 2026 15:17
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

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

As this is a new hook, add the new methods just like in #5442:

  • all()
  • register()

*/
final public static function postDispatch(Request $request): void
{
foreach (static::all('Request') as $hook) {
Copy link
Member

Choose a reason for hiding this comment

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

Are you extending Hook just to use static:: here?

jrauh01 added 6 commits March 5, 2026 07:20
Add a hook that hooks into different states of a request. The
implementation starts with hooking into after non xhr requests
are dispatched. This is meant to be extended for more more states
like before a request gets dispatched.
Add a function to the Icinga Web Request that checks whether the
request is sent by auto refresh by checking if the request header
`X-Icinga-Autorefresh` is set.
@jrauh01
Copy link
Contributor Author

jrauh01 commented Mar 5, 2026

As this is a new hook, add the new methods just like in #5442:

  • all()
  • register()

I added them and I saw there is already an implementation of Hook\Essentials in #5474 . Depending on what PR will be merged first, the other PR has to be adjusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants