Skip to content

Filesystem Stream Collector

Captures filesystem (file://) stream operations via a PHP stream wrapper proxy — reads, writes, stats, and directory operations.

Filesystem Stream Collector panel

What It Captures

FieldDescription
operationOperation type (open, read, write, stat, unlink, mkdir, etc.)
pathFile path
argsOperation arguments

Data Schema

Operations are grouped by type:

json
{
    "open": [
        {"path": "/app/config/app.php", "args": {"mode": "r"}},
        {"path": "/app/var/cache/data.json", "args": {"mode": "w"}}
    ],
    "stat": [
        {"path": "/app/public/index.php", "args": {}}
    ]
}

Summary (shown in debug entry list):

json
{
    "fs_stream": {
        "open": 15,
        "read": 42,
        "stat": 8,
        "write": 3
    }
}

Contract

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

$collector->collect(
    operation: 'open',
    path: '/app/config/app.php',
    args: ['mode' => 'r'],
);

How It Works

The collector uses a PHP stream wrapper proxy (FilesystemStreamProxyAppDevPanel\Kernel\Collector\Stream\FilesystemStreamProxyDecorator proxy for Filesystem Stream. Intercepts calls and forwards data to collectors.final Kernel · class · implements StreamWrapperInterface) that registers itself for the file:// protocol. All filesystem operations (fopen, file_get_contents, is_file, mkdir, etc.) are intercepted via PHP's stream wrapper mechanism. Paths matching excludePaths patterns are ignored.

Debug Panel

  • Operation groups — filesystem operations grouped by type
  • File path list — all accessed paths with operation details
  • Operation counts — summary of operations per type in sidebar badge (I/O)

Released under the MIT License.