定制 konradmichalik/typo3-dump-server 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

konradmichalik/typo3-dump-server

最新稳定版本:0.6.0

Composer 安装命令:

composer require konradmichalik/typo3-dump-server

包简介

This extension brings the Symfony Var Dump Server to TYPO3.

README 文档

README

Extension icon

TYPO3 extension typo3_dump_server

Latest Stable Version Supported TYPO3 versions Coverage CGL Tests License

This extension brings the Symfony Var Dump Server to TYPO3.

Note

This package is an alternative approach to the default TYPO3 debugging methods or the universal use of xdebug.

The dump server gathers all dump call outputs, e.g. for preventing interference with HTTP or API responses.

Console Command

🔥 Installation

Requirements

  • TYPO3 >= 11.5
  • PHP 8.2+

Composer

Packagist Packagist Downloads

composer require --dev konradmichalik/typo3-dump-server

TER

TER version TER downloads

Download the zip file from TYPO3 extension repository (TER).

📊 Usage

Screencast

Console command

Start the dump server with the following command:

vendor/bin/typo3 server:dump

Console Command

Use the format option to change the output format to html:

vendor/bin/typo3 server:dump --format=html > dump.html

Note

The dump server will be available at tcp://127.0.0.1:9912 by default. Use the environment variable TYPO3_DUMP_SERVER_HOST to change the host.

Dump

Use the dump function in your code:

dump($variable);

// or

\Symfony\Component\VarDumper::dump($variable);

ViewHelper

Use the symfony:dump ViewHelper in your Fluid templates:

<html xmlns:symfony="http://typo3.org/ns/KonradMichalik/Typo3DumpServer/ViewHelpers">

<symfony:dump>{variable}</symfony:dump>

Extension settings

By default, a dump() call will add something like the following output to the frontend if the dump server isn't running:

Dump output in frontend

You can suppress this output with the suppressDump setting in the extension configuration. If this setting is enabled, the output will be suppressed and the dump will only be sent to the dump server.

You can find the extension settings in the TYPO3 backend under Admin Tools > Settings > Extension Configuration > typo3_dump_server.

Programmatic Handling

You can listen to dump events programmatically using TYPO3's PSR-14 event system:

use KonradMichalik\Typo3DumpServer\Event\DumpEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;

#[AsEventListener]
final class MyDumpEventListener
{
    public function __invoke(DumpEvent $event): void
    {
        $value = $event->getValue();
        $type = $event->getType();
        
        // Your custom logic here
        error_log("Dumped {$type}: " . print_r($value, true));
    }
}

Note

Register your event listener via the AsEventListener attribute (TYPO3 >= 13) or in your service configuration (see docs).

🧑‍💻 Contributing

Please have a look at CONTRIBUTING.md.

💛 Acknowledgements

This project is highly inspired by the laravel-dump-server & the symfony var-dumper component itself.

⭐ License

This project is licensed under GNU General Public License 2.0 (or later).

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-02-19