phpdebugbar icon indicating copy to clipboard operation
phpdebugbar copied to clipboard

Support for stacking data upon redirect

Open spotman opened this issue 7 years ago • 3 comments

It would be nice to save debug info if response has Location header or it's status code is between 300 and 400. Debug bar can handle this via $debugBar->stackData() call.

More details here http://phpdebugbar.com/docs/ajax-and-stack.html#stacked-data

spotman avatar Oct 11 '18 07:10 spotman

@spotman I don't know what exactly I can do with this

snapshotpl avatar May 02 '19 17:05 snapshotpl

@spotman I don't know what exactly I can do with this

  • check response is a redirect here https://github.com/php-middleware/phpdebugbar/blob/master/src/PhpDebugBarMiddleware.php#L54
  • call $debugbar->stackData() if it is a redirect

Doing this way all DebugBar data will be saved in case of redirect (Post-Redirect-Get pattern, for example). But there is no direct access to DebugBar instance from middleware, only JavascriptRenderer is injected in the constructor.

spotman avatar May 06 '19 02:05 spotman

@snapshotpl is there any progress on this issue? Will you accept a PR with a tiny non-BC-break fix?

spotman avatar Feb 10 '20 07:02 spotman