Skip to content

Conversation

kakserpom
Copy link
Contributor

  • bug fix / new feature? feature
  • BC break? no
  1. $disableHandlers allows to disable register_shutdown_handlers() and set_exception_handler() and use your own handlers.

  2. Pjax support (https://github.com/defunkt/jquery-pjax). We treat Pjax requests not like regular Ajax requests.

@milo
Copy link
Member

milo commented Nov 8, 2018

ad 1) When you disable Tracy's handlers, what is the purpose of Tracy then? You don't need it enabled after all.

ad 2) It is non systematic solution. You can detect HTTP_X_PJAX header in bootstrap and disable Tracy or its bar.

@kakserpom
Copy link
Contributor Author

kakserpom commented Nov 8, 2018

  1. I have my own handlers, but I need Tracy enabled. My own handlers can call Debugger::exceptionHandler($exception, false). Btw, Debugger::exceptionHandler has two arguments and the callback of set_exception_handler() has only one.

  2. I don't want to disable Tracy, I want to get HTML output for Pjax requests, but they are treated like regular Ajax requests by default.

@adrianbj
Copy link
Contributor

adrianbj commented Nov 8, 2018

The concept/need behind this seems somewhat similar to this: #279

I still have to modify the Tracy core on each update to include those changes. I think it wouldn't bet great to have some flexibility to override various handlers.

@milo
Copy link
Member

milo commented Nov 8, 2018

I have my own handlers, but I need Tracy enabled. My own handlers can call Debugger::exceptionHandler($exception, false). Btw, Debugger::exceptionHandler has two arguments and the callback of set_exception_handler() has only one.

You can overload exception handler after Tracy is enabled.

Tracy\Debugger::enable(...);
$prev = null;
$prev = set_exception_handler(function (...) use (&$prev) {
    ...
    if ($prev) $prev(...func_get_args());
});

and the same for error handler:

set_error_handler(function (...) {
   ...
   return false;  # Call previous one
});

I just want to say, that PHP has already API for it.

I don't want to disable Tracy, I want to get HTML output for Pjax requests, but they are treated like regular Ajax requests by default.

So why the requests looks like AJAX when they are not? Isn't Pjax library issue? You can always modify $_SERVER content to mimic the situation.

@dg dg force-pushed the master branch 7 times, most recently from 729637b to c458b58 Compare February 11, 2019 11:56
@dg dg force-pushed the master branch 2 times, most recently from c086066 to d52afaa Compare February 12, 2019 18:25
@dg dg force-pushed the master branch 10 times, most recently from 342ef20 to 6d06dc1 Compare May 24, 2020 23:32
@dg dg force-pushed the master branch 8 times, most recently from 55360f2 to 867c2b6 Compare October 13, 2020 21:03
@dg dg force-pushed the master branch 7 times, most recently from a2951f1 to 1116024 Compare October 14, 2020 18:45
@dg dg closed this Oct 14, 2020
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.

5 participants