php-debug

Atom Text Editor package for PHP debugging

  • 所有者: gwomacks/php-debug
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Atom PHP Debugging Package

Debug PHP code using the Xdebug PHP Extension.

Features

  • Interactive Console
  • Breakpoints
  • Watches
  • Multiple Debug Sessions
  • Path Mappings
  • Step through debugging (Over, In, Out)
  • Stack and Context views
  • UTF8 Support
  • Uses atom-debug-ui

This is currently an alpha release, and still in active development.

Getting Started

Install Xdebug

You may already have Xdebug installed. Check the results of the phpinfo function for xdebug information.
If no xdebug section exists, you likely need to install this. *nix users can likely find it within their package manager of choice.
Alternative installation or compiling instructions are available here.

Setting up Xdebug

xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1    # Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true

With these settings, PHP will connect to your editor for every script it executes.
The alternative is to switch xdebug.remote_autostart to false, and install an Xdebug helper extension for your browser of choice, such as:

These browser extensions will give you a button within your browser to enable/disable Xdebug. The extensions might have configuration options for an "IDE key" (which is used for an XDEBUG_SESSION cookie). The IDE key for Atom with PHP Debug is "xdebug-atom".

It is also possible to run a php script from the command line with Xdebug enabled.
You can find more information on this at the Xdebug documentation for Starting The Debugger.
See can find a complete list and explanation of Xdebug settings here.

Start Debugging

To begin debugging:

  1. Open up your PHP file in atom
  2. Add a breakpoint:

Move the cursor to a line you want to break on and set a breakpoint by pressing Alt+F9, selecting Toggle Breakpoint from the Command Palette (ctrl+shift+p)or with the php-debug menu (Packages -> php-debug->Toggle Breakpoint).
This will highlight the line number green, to indicate the presence of a breakpoint.

  1. Open the debug view by pressing ctrl+alt+d, selecting 'Toggle Debugging' from the Command Palette or php-debug menu.
  2. Start the script with Xdebug enabled. If everything is setup correctly, the entire line of the breakpoint will be highlighted in green, indicating the current line of the script.

If everything worked correctly, you can now use the various buttons/commands to step through the script.

Settings

Server Port

This is the port that the atom client will listen on.
Defaults to 9000

Server Address

This is the address that the atom client will listen on.
Defaults to 127.0.0.1

Xdebug DBGP Protocol Debugging

Outputs protocol debugging messages to the atom debug console

Xdebug: Max Depth

Max depth for variable scopes

Xdebug: Max children

Maximum number of array elements to show in variables

Xdebug: Max Data

Maximum data for variables

Display: Sort Arrays/Object alphabetically

Sort Arrays/Object alphabetically instead of by php default

Display: Status Bar

Allow PHP Debug to be opened from the status bar

Exceptions

Default exceptions and errors for PHP-Debug to break on

Path Maps

Pathmaps are now configured for each project folder during connection

主要指标

概览
名称与所有者gwomacks/php-debug
主编程语言JavaScript
编程语言CoffeeScript (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2015-04-23 23:53:07
推送于2022-08-21 13:47:02
最后一次提交2018-10-05 13:38:57
发布数31
最新版本名称v0.3.5 (发布于 2018-05-26 11:28:59)
第一版名称v0.0.1 (发布于 )
用户参与
星数119
关注者数11
派生数31
提交数288
已启用问题?
问题数291
打开的问题数53
拉请求数30
打开的拉请求数7
关闭的拉请求数9
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?