承接 dragontnt/vardumper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dragontnt/vardumper

最新稳定版本:v1.0.0-alpha.1

Composer 安装命令:

composer require dragontnt/vardumper

包简介

Simple var dumper for CLI and HTML compatible with PHP 7.4+

关键字:

README 文档

README

A lightweight PHP dumper for CLI and HTML environments.
Supports PHP 7.4+ and designed for simplicity and readability.

Features

  • Dump variables in CLI or HTML format
  • Handles scalars, arrays, objects, and nested structures
  • Automatically detects environment (CLI or Web)
  • PSR-4 autoloading ready
  • No external dependencies

Installation

composer require dragontnt/vardumper

Usage

use Dumper\Dumper;

dd($data); // Auto detect and dump to CLI or HTML

Example

require_once __DIR__ . '/../vendor/autoload.php';

class User
{
    private $id;
    public $name;
    public $email;
    public $role;

    public function __construct($id, $name, $email, $role)
    {
        $this->id = $id;
        $this->name = $name;
        $this->email = $email;
        $this->role = $role;
    }
}

$user1 = new User(101, "John Doe", "john@example.com", "Admin");
$user2 = new User(102, "Jane Smith", "jane@example.com", "Editor");

$settings = [
    "theme" => "dark",
    "notifications" => true,
    "language" => "English",
    "meta" => ["version" => "1.2.3", "lastUpdate" => "2025-04-02"]
];

dd(
    "Hello World!",
    12345,
    true,
    null,
    [1, 2, "test", false],
    ["key1" => "value1", "key2" => 42, "nested" => ["a" => "A", "b" => [10, 20, 30]]],
    $user1,
    $user2,
    $settings,
    new DateTime(),
    new class {
        private $secret = 'hidden';
    }
);

API

Method Description
Dumper::dump() Dump auto (CLI or HTML)
dd() Global shortcut for dump + exit

Requirements

  • PHP 7.4 or higher

Contributing

Contributions are welcome! Here's how to help:

  1. Fork the repository
  2. Create a new branch for your feature or fix
  3. Write tests if applicable
  4. Submit a pull request with a clear description of your changes

Please follow PSR-12 coding standards.
Keep the package lightweight and dependency-free.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-07