Skip to content

HTTP Stream Collector

Captures HTTP/HTTPS stream wrapper operations — requests made via file_get_contents('http://...'), fopen('https://...'), and similar PHP stream functions.

HTTP Stream Collector panel

What It Captures

FieldDescription
operationStream operation type (open, read, stat, etc.)
uriHTTP/HTTPS URL accessed
argsOperation arguments

Data Schema

Operations are grouped by type:

json
{
    "open": [
        {"uri": "https://api.example.com/data", "args": {"mode": "r"}}
    ]
}

Summary (shown in debug entry list):

json
{
    "http_stream": {
        "open": 2,
        "read": 2
    }
}

Contract

php
use AppDevPanel\Kernel\Collector\Stream\HttpStreamCollector;

$collector->collect(
    operation: 'open',
    path: 'https://api.example.com/data',
    args: ['mode' => 'r'],
);

How It Works

The collector uses a PHP stream wrapper proxy (HttpStreamProxyAppDevPanel\Kernel\Collector\Stream\HttpStreamProxyDecorator proxy for Http Stream. Intercepts calls and forwards data to collectors.final Kernel · class · implements StreamWrapperInterface) that registers itself for the http:// and https:// protocols. Stream operations via native PHP functions are intercepted. Paths matching excludePaths patterns are ignored.

WARNING

This collector only captures HTTP requests made via PHP stream functions (file_get_contents, fopen). For PSR-18 HTTP client calls, use the HTTP Client Collector.

Debug Panel

Released under the MIT License.