Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The package overrides the default Laravel's VarDumpers and file context disappears

オープン
#95 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
laravel, php

調査の方向性

まず DumpServerServiceProvider を調査し、php artisan dump-server の実行時と未実行時の違いを再現します。その際、Laravel の HtmlDumper と CliDumper のハンドラーに注目してください。パッケージが VarDumper をどのように登録し、コマンドをどのように有効化しているかを確認します。コマンドを実行していないときもファイルコンテキストが表示されたままになり、dump-server の動作を壊さなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

When this package is installed, it overrides VarDumper handler that comes from Laravel (Illuminate\Foundation\Http\HtmlDumper and Illuminate\Foundation\Console\CliDumper).

To compare, when the package is not installed:
Screenshot 2024-11-21 at 13 04 11

And when it is installed, but the command not running:
Screenshot 2024-11-21 at 13 04 28

The same in CLI.

When the command (php artisan dump-server) is not running, I would like to see the file context by default.


Suggestion:

As a suggestion, maybe the setting could be introduced to enable/disable the package? E.g. config:

...
    'enabled' => env('DUMP_SERVER_ENABLED', true),
...

Then in DumpServerServiceProvider it could be conditionally loaded:

        if ($this->app['config']->get('debug-server.enabled')) {
            VarDumper::setHandler(function ($var) use ($connection) {
                $this->app->makeWith(Dumper::class, ['connection' => $connection])->dump($var);
            });
        }

The command php artisan dump-server could give an error if it is not enabled:

        if (! config('dump-server.enabled')) {
            $this->error('The dump server is not enabled.');

            return;
        }

This would allow users to choose if they want it always enabled, or occasionally and would not override other VarDump registered handlers.

WDYT, I could open a pull request if it's reasonable idea.

主要言語
PHP
スター
1.6k
フォーク
90
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

beyondcode/laravel-dump-server のほかの issue

beyondcode/laravel-dump-server の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。