Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
41a22f2
feat(xdebug): receive Xdebug function traces and serve their call tre…
roxblnfk Nov 21, 2026
c01381e
feat(xdebug): step-debug PHP from the web UI and AI agents, or relay …
roxblnfk Nov 21, 2026
a7844c0
feat(ui): Sentry v2 and OpenTelemetry data for the web UI: ingestion,…
roxblnfk Nov 21, 2026
528ed89
feat(ui): service map and call sequence of the Sentry traces (#374)
roxblnfk Nov 21, 2026
b7fc3d0
feat(ui): update the web UI to buggregator/frontend 1.39.0
roxblnfk Nov 21, 2026
a132144
feat(ui): pin events and keep pinned ones on clear
roxblnfk Nov 21, 2026
b0798ab
feat(ui): push events, their deletes and clears to project channels
roxblnfk Nov 21, 2026
4ed8b2d
fix(ui): answer 400 to a request parameter of a wrong type or a missi…
roxblnfk Nov 21, 2026
64d11d8
feat(sentry): clear Sentry events with `DELETE /api/sentry/all`
roxblnfk Nov 21, 2026
e6eed77
feat(mailer): serve mail attachments at the paths of the UI 1.39
roxblnfk Nov 21, 2026
2a620fa
feat(http-dump): download the files uploaded with a dumped request
roxblnfk Nov 21, 2026
0350594
feat(profiler): draw the flame chart by any metric and compare two pr…
roxblnfk Nov 21, 2026
c46a31e
security(smtp): sandbox the email HTML and inline files opened by the…
roxblnfk Nov 21, 2026
9515514
fix(ui): drop CORS from the web UI
roxblnfk Nov 21, 2026
82e34d1
refactor(ui): serve the Xdebug and Sentry pages through the responses…
roxblnfk Nov 21, 2026
b3d209d
build: update dependencies
roxblnfk Nov 21, 2026
46acd06
docs(skill): align the trap skill with the Xdebug debugger, traces an…
roxblnfk Nov 21, 2026
02e26d3
docs: list the `xdebug-trace` filter type, pinned events in `clear_ev…
roxblnfk Nov 21, 2026
5b8cf2a
feat(mcp): keep pinned events in `clear_events` unless `include_pinne…
roxblnfk Nov 21, 2026
228aa99
feat(command): make `trap test` send a sample of every kind of event
roxblnfk Nov 22, 2026
09a0332
fix(xdebug): show the source at an exception break
roxblnfk Nov 22, 2026
1072b4d
feat(xdebug): give agents the exception of a pause, eval errors, step…
roxblnfk Nov 22, 2026
d9a87cf
docs(skill): teach the trap skill exception breaks, stepping and a Tr…
roxblnfk Nov 22, 2026
f8eba44
fix(xdebug): read a source at an exception break only from a file the…
roxblnfk Nov 22, 2026
41c0344
fix(xdebug): catch eval warnings with an error handler of Trap, take …
roxblnfk Nov 22, 2026
aaec13c
feat(xdebug): return the value of a step out, keep breakpoint hits af…
roxblnfk Nov 22, 2026
ff6defc
docs(skill): correct the eval line, add breakpoint, exception and Pow…
roxblnfk Nov 22, 2026
7a24833
fix(xdebug): read a source only for an engine on this host, and only …
roxblnfk Nov 22, 2026
e9cbdf0
fix(xdebug): take the eval error handler off even when the eval times…
roxblnfk Nov 22, 2026
cb09694
fix(xdebug): list the breakpoint hits of the session that closed last
roxblnfk Nov 22, 2026
6f6aec9
docs(skill): correct the eval line, add a whole PowerShell run, refin…
roxblnfk Nov 22, 2026
94c5966
fix(xdebug): name the caller after a step out, keep the location when…
roxblnfk Nov 22, 2026
09575ee
test(xdebug): cover the eval release after a timeout and loopback eng…
roxblnfk Nov 22, 2026
de1b62c
docs(skill): run the PowerShell example on the recipe's ports, soften…
roxblnfk Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
*.jpg binary
*.pb binary
*.png binary
*.woff2 binary

# Snapshots compared byte by byte, whatever `core.autocrlf` says.
/tests/Stub/otlp-render/*.txt text eol=lf
/tests/Stub/spx/*.txt text eol=lf
/tests/Stub/spx/**/*.gz binary
/tests/Stub/xdebug/**/*.gz binary
/resources/payloads/*.gz binary
/tests/Stub/spx/real/*.json text eol=lf
# Raw SMTP data: lines end with CRLF on the wire
/tests/Stub/mail/*.eml text eol=crlf
Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
[Buggregator Server](https://github.com/buggregator/server) written in PHP and made for local development: it runs
on the PHP of your project, so it reads the profiles of XHProf, Xdebug and SPX right from their directories.
Unlike the `symfony/var-dumper` server, it receives far more than dumps: Monolog logs, Sentry events, emails,
Ray payloads, HTTP requests, OpenTelemetry traces and profiles, all on the same ports. The functions work with any
Ray payloads, HTTP requests, OpenTelemetry traces, logs and metrics and profiles, all on the same ports. The functions work with any
Buggregator server. Use PhpStorm? Try Trap with the [Buggregator Plugin](https://github.com/buggregator/phpstorm-plugin).

**Debug long-running applications.** In a RoadRunner, Swoole or FrankenPHP worker, under Laravel Octane or in a queue
Expand Down Expand Up @@ -115,11 +115,11 @@ OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318
Everything Trap catches is rendered right in the terminal:

| symfony/var-dumper (proto) | Binary Data |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
| ![var-dumper](https://github.com/buggregator/trap/assets/4152481/f4c855f5-87c4-4534-b72d-5b19d1aae0b0) | ![Binary Data](https://github.com/buggregator/trap/assets/4152481/cd8788ed-b10c-4b9a-b2e2-baa8912ea38d) |

| SMTP Mail Trap | HTTP Dump |
|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| ![smtp](https://github.com/buggregator/trap/assets/4152481/b11c4a7f-072a-4e66-b11d-9bbd3177bfe2) | ![http-dump](https://github.com/buggregator/trap/assets/4152481/48201ce6-7756-4402-8954-76a27489b632) |

Let an AI agent read it too: with `--mcp`, Trap serves what it caught over MCP, so an agent that adds `trap()` calls
Expand Down Expand Up @@ -192,22 +192,24 @@ The dump shows up in the terminal of the server. `tr(...)` equals `trap(...)->re
Trap detects the protocol of each connection, so every port takes every kind of traffic.
The ports below are the defaults of the clients.

| What | Point the client at it | Docs |
|-----------------------------|------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| Symfony VarDumper, `trap()` | `VAR_DUMPER_FORMAT=server`, `VAR_DUMPER_SERVER=127.0.0.1:9912` | [var-dumper](docs/var-dumper.md) |
| Monolog | `SocketHandler('127.0.0.1:9913')` with `JsonFormatter` | [Monolog](docs/monolog.md) |
| Sentry | `SENTRY_DSN=http://sentry@127.0.0.1:8000/1` | [Sentry](docs/sentry.md) |
| SMTP | `MAILER_DSN=smtp://127.0.0.1:1025` | [SMTP](docs/smtp.md) |
| Ray | host `127.0.0.1`, port `8000` in `ray.php` | [Ray](docs/ray.md) |
| HTTP dumps | any HTTP request, e.g. `http://127.0.0.1:8000/webhook` | [HTTP dumps](docs/http-dump.md) |
| OpenTelemetry traces | `OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318` | [OpenTelemetry](docs/opentelemetry.md) |
| Profiles | `trap()::profile()`, `POST /api/profiler/*`, a watched directory | [Profiling](docs/profiling.md), [receiving](docs/profiles.md), [SPX](docs/spx.md) |
| Binary data | any raw bytes | |
| What | Point the client at it | Docs |
| --------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| Symfony VarDumper, `trap()` | `VAR_DUMPER_FORMAT=server`, `VAR_DUMPER_SERVER=127.0.0.1:9912` | [var-dumper](docs/var-dumper.md) |
| Monolog | `SocketHandler('127.0.0.1:9913')` with `JsonFormatter` | [Monolog](docs/monolog.md) |
| Sentry | `SENTRY_DSN=http://sentry@127.0.0.1:8000/1` | [Sentry](docs/sentry.md) |
| SMTP | `MAILER_DSN=smtp://127.0.0.1:1025` | [SMTP](docs/smtp.md) |
| Ray | host `127.0.0.1`, port `8000` in `ray.php` | [Ray](docs/ray.md) |
| HTTP dumps | any HTTP request, e.g. `http://127.0.0.1:8000/webhook` | [HTTP dumps](docs/http-dump.md) |
| OpenTelemetry (OTLP) | `OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318` | [OpenTelemetry](docs/opentelemetry.md) |
| Profiles | `trap()::profile()`, `POST /api/profiler/*`, a watched directory | [Profiling](docs/profiling.md), [receiving](docs/profiles.md), [SPX](docs/spx.md) |
| Xdebug step debugging | `--xdebug`, `xdebug.client_port=9003`, the IDE moved to `9004` | [Xdebug debugger](docs/xdebug.md) |
| Xdebug function traces | `POST` with `X-Buggregator-Event: xdebug-trace`, a watched directory | [Xdebug traces](docs/xdebug-traces.md) |
| Binary data | any raw bytes | |

## Configuration

| Option or variable | Default | Meaning |
|----------------------------------|----------------------------|---------------------------------------------|
| -------------------------------- | -------------------------- | ------------------------------------------- |
| `-p`, `--port`, `TRAP_TCP_PORTS` | `1025,4318,8000,9912,9913` | Ports to listen on |
| `TRAP_TCP_HOST` | `127.0.0.1` | Host to listen on |
| `-s`, `--sender` | `console` | Where events go: [senders](docs/senders.md) |
Expand Down
4 changes: 4 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
"Google\\Protobuf\\Internal\\MapField",
"Google\\Protobuf\\Internal\\Message",
"Google\\Protobuf\\Internal\\RepeatedField",
"libxml_clear_errors",
"LIBXML_NOERROR",
"LIBXML_NONET",
"libxml_use_internal_errors",
"Opentelemetry\\Proto\\Collector\\Trace\\V1\\ExportTraceServiceRequest",
"SIGINT",
"SIGTERM",
"simplexml_load_string",
"SimpleXMLElement",
"Symfony\\Component\\HttpFoundation\\Request",
"Symfony\\Component\\HttpFoundation\\RequestStack",
"Symfony\\Component\\HttpKernel\\Debug\\FileLinkFormatter",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"suggest": {
"ext-excimer": "To profile code with trap()::profile() using the Excimer sampling profiler",
"ext-openssl": "To accept TLS connections (HTTPS, SMTPS, STARTTLS) and to connect over TLS",
"ext-simplexml": "To load trap.xml",
"ext-simplexml": "To load trap.xml and to run the Xdebug debugger",
"ext-spx": "To profile code with trap()::profile() using the SPX profiler",
"ext-tideways_xhprof": "To profile code with trap()::profile() using XHProf",
"ext-xhprof": "To profile code with trap()::profile() using XHProf",
Expand Down
Loading
Loading