innmind/silent-cartographer

用于可视化操作系统的进程库

2.2.0 2021-02-14 15:45 UTC

This package is auto-updated.

Last update: 2024-09-14 23:51:01 UTC


README

Build Status codecov Type Coverage

一个简单的工具,用于可视化其他PHP应用程序内部对操作系统的所有操作。

安装

对于命令行工具

composer global require innmind/silent-cartographer

您想要查看操作的项目中

composer require innmind/silent-cartographer

使用方法

为了监视所有活动

silent-cartographer panel

在您的项目中发送活动

use Innmind\CLI\{
    Main,
    Environment,
};
use Innmind\OperatingSystem\OperatingSystem;
use Innmind\Url\Path;
use function Innmind\SilentCartographer\bootstrap;

new class extends Main {
    protected function main(Environment $env, OperatingSystem $os): void
    {
        $os = bootstrap($os)['cli'](Path::of(__DIR__));
        // then use the $os variable like you would normally do
    }
}

在HTTP服务器环境中使用http_server上下文(而不是cli),区别在于如果请求接收时没有激活面板,则将永远不会尝试在请求处理剩余部分发送任何活动到面板(这样做是为了减少性能影响)。