shyim / php-dump-client

v0.0.8 2021-12-16 14:22 UTC

This package is auto-updated.

Last update: 2024-09-16 20:36:50 UTC


README

这是一个华丽的Symfony Var-Dump服务器。该存储库包含用于将信息发送到UI服务器的PHP客户端的代码。

该项目目前正在开发中

安装

composer req shyim/php-dump-client

或前缀(不需要其他依赖项)

composer req shyim/php-dump-client-prefixed

或全局可用的auto_prepend_file

  • shyim/php-dump-client-prefixed克隆到某个位置
  • 配置auto_prepend_file=PREFIXED_FOLDER/prepend.php

使用方法

  • 首先启动 调试服务器
  • 可选:如果dump服务器不在本地运行,请将环境变量PHP_DUMP_SERVER_URL设置为Dump服务器
  • 使用您喜欢的pd()命令
// Sends variables to the UI Server to show
pd()->log($var1, $var2);

// Sends the trace to the UI
pd()->trace();

// Clears the ui window
pd()->clear();

// Stops the process until its unlocked in the UI
pd()->pause();

// Show execution time of function and memory usage
pd()->time('Label', function() {
  sleep(1);
});

// Show execution time of function and memory usage
$timer = pd()->time('Label');

// Do something

$timer->stop();

// Allows tagging of calls in the UI
pd()->tag('My-Tag')->Method($args);