Skip to content

Instantly share code, notes, and snippets.

@nojimage
Last active December 29, 2020 00:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nojimage/02e93e8a266f706d4a6d47405fcb34b0 to your computer and use it in GitHub Desktop.
Save nojimage/02e93e8a266f706d4a6d47405fcb34b0 to your computer and use it in GitHub Desktop.
Xdebug 3 アップグレードガイド

Xdebug 3 アップグレードガイド

原文: https://xdebug.org/docs/upgrade_guide

Xdebug 2 から 3 へのアップグレード

An upgrade guide detailing which changes there are between Xdebug 2 and 3, and how to reconfigure your set-up to do similar things.

このアップグレードガイドは、Xdebug 2から3への変更点と、同様のことを行うようにセットアップを再構成する方法を詳しく説明します。

新しいコンセプト

Unlike Xdebug 2, where there was an enabling setting for each feature, with Xdebug 3 you put Xdebug into a specific mode, which can be configured with the xdebug.mode setting.

各機能の有効化設定があったXdebug 2とは異なり、Xdebug 3では、Xdebugを特定のモードにします。これは xdebug.mode で設定できます。

This setting, in combination with xdebug.start_with_request is the new way to enable functionality, and to configure when Xdebug's feature activates.

この設定と xdebug.start_with_request を組み合わせる方法が、Xdebugの機能を有効にし、機能をアクティブにするタイミングを設定する新しい方法になります。

The idea behind this is that it is important that Xdebug only has overhead for the features that are actually wanted. For example, it makes no sense have both Profiling and Step Debugging active at the same time.

この背景には、Xdebugが実際に必要な機能のオーバーヘッドのみを持つことが重要であると考えているからです。たとえば、プロファイリングとステップデバッギングの両方を同時にアクティブにすることは意味がありません。

Besides setting the mode with xdebug.mode, you can also set the mode with the XDEBUG_MODE environment variable. If this environment variable is active, it overrides the mode as set through xdebug.mode.

xdebug.mode を使用してモードを設定する以外に、XDEBUG_MODE 環境変数を使用してモードを設定することもできます。この環境変数が有効な場合、xdebug.mode で設定されたモードを上書きします。

To make sure that just Step Debugging is active, instead of:

ステップデバッギングのみがアクティブであるようにするには、次の代わりに:

xdebug.remote_enable=1
xdebug.default_enable=0
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.coverage_enable=0

You now only do:

このようにするだけです:

xdebug.mode=debug

Or, on the command line:

もしくはコマンドライン上で:

export XDEBUG_MODE=debug
php script-name.php

ステップデバッギング

Xdebug's default debugging port has changed from 9000 to 9003.

Xdebugの標準のデバッギングポートは 9000 から 9003 へ変更されました。

コマンドラインで有効化する

Instead of setting the XDEBUG_CONFIG environment variable to idekey=yourname, you must set XDEBUG_SESSION to yourname:

XDEBUG_CONFIG 環境変数に idekey=yourname を設定する代わりに、XDEBUG_SESSIONyourname を設定する必要があります。

export XDEBUG_SESSION=xdebug_is_great

デバッガーを自動で開始する

The xdebug.remote_autostart setting has been removed. Instead, set xdebug.start_with_request to yes.

xdebug.remote_autostart の設定は削除されました。 代わりに xdebug.start_with_requestyes にセットしてください。

リクエスト中にデバッガーを開始する

In Xdebug 3 calling xdebug_break() will only initiate a debugging session when xdebug.start_with_request is set to trigger.

Xdebug 3では、xdebug_break() を呼び出すと、xdebug.start_with_requesttrigger に設定されている場合にのみデバッグセッションを開始します。

It will no longer trigger a debugging session when xdebug.start_upon_error=yes (the replacement for Xdebug 2's xdebug.remote_mode=jit).

xdebug.start_upon_error=yesの場合、デバッグセッションがトリガーされなくなります(Xdebug 2 の xdebug.remote_mode=jit の代替です)。

A debug session will be initiated upon a PHP Notice or Warning, or when a Throwable is thrown, when xdebug.start_upon_error is set to yes, regardless of what the value for xdebug.start_with_request is.

デバッグセッションは、xdebug.start_upon_erroryes に設定されたときは、xdebug.start_with_request の値に関係なく、PHPのNoticeまたはWarning、またはThrowableがスローされたときに開始されます。

関数の振る舞いの変更

xdebug_break()

This function will no longer initiate a debugging session when xdebug.start_upon_error is set to yes (the replacement for Xdebug 2's xdebug.remote_mode=jit).

この関数は、xdebug.start_upon_erroryesにセットされた場合、デバッグセッションが開始されなくなりました(Xdebug 2 の xdebug.remote_mode=jit の代替です)。

It will still initate a debugging request when xdebug.start_with_request is set to trigger.

これはまだ、xdebug.start_with_requesttrigger に設定されている場合は、デバッグ要求を開始します。

構成設定の変更

Xdebug 3 has removed and changed a lot of configuration settings. This section lists the removed settings and their replacements.

Xdebug 3 では、多くの構成設定を削除および変更しました。このセクションには、削除された設定とその置き換えを一覧で示します。

xdebug.auto_trace

Use xdebug.mode=trace with xdebug.start_with_request=yes.

xdebug.mode=trace と合わせて xdebug.start_with_request=yes を使用してください。

xdebug.collect_includes

Has been removed. File names for include() and require() are now always included in Development Aids and Function Trace output.

削除されました。include()require() のファイル名は、 Development AidsFunction Trace の出力に常に含まれるようになりました。

xdebug.collect_params

Has been removed. Arguments are now always visible with variable contents and argument name in Development Aids and Function Trace output.

削除されました。引数は、引数名と変数の内容と合わせて、 Development AidsFunction Trace の出力に常に含まれるようになりました。

xdebug.collect_vars

Has been removed, it was only used in combination with the xdebug_get_declared_vars() function, which has also been removed.

削除されました。これは、xdebug_get_declared_vars() 関数との組み合わせでのみ使用されていましたが、これも削除されました。

xdebug.coverage_enable

Use xdebug.mode=coverage.

xdebug.mode=coverage を使用してください。

xdebug.default_enable

Use xdebug.mode=develop.

xdebug.mode=develop を使用してください。

xdebug.extended_info

No replacement. Xdebug turns on this PHP engine setting automatically when needed.

代替はありません。 Xdebugは、必要に応じてこのPHPエンジン設定を自動的にオンにします。

xdebug.gc_stats_enable

Use xdebug.mode=gcstats.

xdebug.mode=gcstats を使用してください。

xdebug.gc_stats_output_dir

Use the generic xdebug.output_dir setting.

一般的な xdebug.output_dir の設定を使用してください。

xdebug.overload_var_dump

Has been removed. PHP's var_dump() is now always overloaded through xdebug_var_dump() when xdebug.mode is set to develop. The xdebug_var_dump() function is available independent of which mode is configured.

削除されました。xdebug.modedevelop に設定されている場合、PHPの var_dump() は常に xdebug_var_dump() によって上書きされるようになりました。 xdebug_var_dump() 関数は、構成されているモードに関係なく使用できます。

xdebug.profiler_enable

Use xdebug.mode=profile.

xdebug.mode=profile を使用してください。

xdebug.profiler_enable_trigger

Use xdebug.mode=profile with xdebug.start_with_request=trigger.

xdebug.mode=profile と合わせて xdebug.start_with_request=trigger を使用してください。

xdebug.profiler_enable_trigger_value

Use the generic xdebug.trigger_value setting.

一般的な xdebug.trigger_value の設定を使用してください。

xdebug.profiler_output_dir

Use the generic xdebug.output_dir setting.

一般的な xdebug.output_dir の設定を使用してください。

xdebug.remote_addr_header

Replaced by xdebug.client_discovery_header.

xdebug.client_discovery_header に置き換えられました。

xdebug.remote_autostart

Use xdebug.mode=debug with xdebug.start_with_request=yes.

xdebug.mode=debug と合わせて xdebug.start_with_request=yes を使用してください。

xdebug.remote_connect_back

Replaced by xdebug.discover_client_host.

xdebug.discover_client_host に置き換えられました。

xdebug.remote_enable

Use xdebug.mode=debug.

xdebug.mode=debug を使用してください。

xdebug.remote_handler

No replacement. Xdebug's step debugger only supported the DBGp handler.

代替はありません。 XdebugのステップデバッガーはDBGPハンドラーのみをサポートしています。

xdebug.remote_host

Replaced by xdebug.client_host.

xdebug.client_host に置き換えられました。

xdebug.remote_log

Replaced by xdebug.log, which also includes log messages beyond Step Debugging.

xdebug.log に置き換えられました。これはステップデバッギング以外のログメッセージも含まれます。

xdebug.remote_log_level

Replaced by xdebug.log_level.

xdebug.log_level に置き換えられました。

xdebug.remote_mode

For the req value (the original default), use xdebug.mode=debug with xdebug.start_with_request=trigger. If the original xdebug.remote_autostart behaviour is necessary, use xdebug.start_with_request=yes instead of trigger.

req(元のデフォルト)であれば、xdebug.mode=debugxdebug.start_with_request=trigger を使用します。元の xdebug.remote_autostart の動作が必要な場合は、trigger の代わりに xdebug.start_with_request=yes を使用してください。

For the jit value, use xdebug.mode=debug and xdebug.start_upon_error=yes.

jit であれば、xdebug.mode=debugxdebug.start_upon_error=yes を使用してください。

xdebug.remote_port

Replaced by xdebug.client_port.

xdebug.client_port に置き換えられました。

The default value has also changed from 9000 to 9003.

デフォルト値は、9000 から 9003 に変更されました。

xdebug.remote_timeout

Replaced by xdebug.connect_timeout_ms.

xdebug.connect_timeout_ms に置き換えられました。

xdebug.show_mem_delta

Has been removed. The difference in memory usage can be calculated by comparing the usage in the current frame with the previous one.

削除されました。メモリ使用量の差異は、現在のフレームの使用量を前のフレームの使用量と比較することで計算できます。

xdebug.trace_output_dir

Use the generic xdebug.output_dir setting.

一般的な xdebug.output_dir の設定を使用してください。

xdebug.trace_enable_trigger

Use xdebug.mode=trace with xdebug.start_with_request=trigger.

xdebug.mode=trace と合わせて xdebug.start_with_request=trigger を使用してください。

xdebug.trace_enable_trigger_value

Use the generic xdebug.trigger_value setting.

一般的な xdebug.trigger_value の設定を使用してください。

関数への変更

xdebug_disable()

Has been removed.

削除されました。

To prevent Xdebug from showing stack traces, do not configure Xdebug's develop mode in xdebug.mode, or turn off PHP's html_errors INI setting.

Xdebugがスタックトレースを表示しないようにするには、xdebug.mode でXdebugの開発モードを構成しないか、PHPのINI設定の html_errors オフにします。

xdebug_enable()

Has been removed.

削除されました。

To configure Xdebug to showing stack traces, include develop in xdebug.mode.

スタックトレースを表示するようXdebugを構成するには、xdebug.modedevelop を含めます。

xdebug_get_declared_vars()

Has been removed.

削除されました。

The information that this function returned can be obtained through the xdebug_get_function_stack() function.

この関数が返していた情報は、xdebug_get_function_stack() 関数を介して取得できます。

xdebug_is_enabled()

Has been removed, but was never originally documented or supported.

削除されました。しかし、元々、文書化またはサポートされていませんでした。

変更された定数

The following constants have been changed:

以下の定数が変更されました:

XDEBUG_PATH_WHITELIST

Is now: XDEBUG_PATH_INCLUDE

現在: XDEBUG_PATH_INCLUDE

XDEBUG_PATH_BLACKLIST

Is now: XDEBUG_PATH_EXCLUDE

現在: XDEBUG_PATH_EXCLUDE

XDEBUG_NAMESPACE_WHITELIST

Is now: XDEBUG_NAMESPACE_WHITELIST

現在: XDEBUG_NAMESPACE_WHITELIST

XDEBUG_NAMESPACE_BLACKLIST

Is now: XDEBUG_NAMESPACE_BLACKLIST

現在: XDEBUG_NAMESPACE_BLACKLIST

v2 v3
xdebug.coverage_enable xdebug.mode=coverage
xdebug.default_enable xdebug.mode=develop
xdebug.gc_stats_enable xdebug.mode=gcstats
xdebug.remote_enable xdebug.mode=debug
xdebug.remote_autostart xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.remote_mode=req
xdebug.remote_autostart=0
xdebug.mode=debug
xdebug.start_with_request=trigger
xdebug.remote_mode=req
xdebug.remote_autostart=1
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.remote_mode=jit xdebug.mode=debug
xdebug.start_upon_error=yes
xdebug.profiler_enable xdebug.mode=profile
xdebug.profiler_enable_trigger xdebug.mode=profile
xdebug.start_with_request=trigger
xdebug.auto_trace xdebug.mode=trace
xdebug.start_with_request=yes
xdebug.trace_enable_trigger xdebug.mode=trace
xdebug.start_with_request=trigger
xdebug.overload_var_dump (削除)
xdebug.remote_addr_header xdebug.client_discovery_header
xdebug.remote_connect_back xdebug.discover_client_host
xdebug.remote_handler (削除)
xdebug.remote_host xdebug.client_host
xdebug.remote_port xdebug.client_port
(デフォルト値は、9000 から 9003 に変更)
xdebug.remote_timeout xdebug.connect_timeout_ms
xdebug.remote_log xdebug.log
xdebug.remote_log_level xdebug.log_level
xdebug.gc_stats_output_dir
xdebug.profiler_output_dir
xdebug.trace_output_dir
xdebug.output_dir
xdebug.profiler_enable_trigger_value
xdebug.trace_enable_trigger_value
xdebug.trigger_value
xdebug.collect_includes (削除)
xdebug.collect_params (削除)
xdebug.collect_vars (削除)
xdebug.extended_info (削除)
xdebug.show_mem_delta (削除)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment