Skip to content

Commit

Permalink
feat: Add support for xdebug 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ndench committed Dec 14, 2020
1 parent db8f57e commit bf8982f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 3 deletions.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ Role Variables

All variables are listed below, along with their default values in [defaults/main.yml](defaults/main.yml):

Variables for installing xdebug:
Variables for installing and configuring xdebug 2:

```yaml
# The version of the xdebug package to install (ie. php7.2-xdebug)
xdebug_php_version: 7.2

xdebug_version: 2

# xdbebug.ini settings
# see: https://xdebug.org/docs/all_settings

Expand All @@ -40,6 +42,35 @@ xdebug_remote_host: 10.0.2.2
xdebug_conf_remote_port: 9000
```
Variables for installing and configuring xdebug 3:
```yaml
# The version of the xdebug package to install (ie. php7.2-xdebug)
xdebug_php_version: 7.2

xdebug_version: 3

# xdbebug.ini settings
# see: https://xdebug.org/docs/all_settings

xdebug_conf_max_nesting_level: 256
xdebug_conf_idekey: PHPSTORM

# The mode to run xdebug in: https://xdebug.org/docs/all_settings#mode
xdebug_conf_mode: debug

# How xdebug should be started https://xdebug.org/docs/all_settings#start_with_request
xdebug_conf_start_with_request: trigger

# Connect to the client that sent the request
xdebug_conf_discover_client_host: 0

# Connect to the specified host (overidden by discover_client_host)
# 10.0.2.2 is the default IP address virtualbox assigns to the host
xdebug_conf_client_host: 10.0.2.2
xdebug_conf_client_port: 9000
```
Dependencies
------------
Expand Down
5 changes: 4 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# The version of the xdebug package to install (ie. php7.2-xdebug)
xdebug_php_version: 7.2

# Whether to configure xdebug 2 or 3
xdebug_version: 2

# xdbebug.ini settings
# see: https://xdebug.org/docs/all_settings

xdebug_conf_max_nesting_level: 256
xdebug_conf_idekey: PHPSTORM

# Start xdebug on every requset, regardless of the GET/POST variable
# Start xdebug on every request, regardless of the GET/POST variable
xdebug_remote_autostart: 0

# Connect to the client that sent the request
Expand Down
9 changes: 8 additions & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@

- name: configure xdebug
template:
src: xdebug.ini.j2
src: xdebug2.ini.j2
dest: /etc/php/{{ php_version }}/mods-available/xdebug.ini
when: xdebug_version == 2

- name: configure xdebug
template:
src: xdebug3.ini.j2
dest: /etc/php/{{ php_version }}/mods-available/xdebug.ini
when: xdebug_version == 3
File renamed without changes.
16 changes: 16 additions & 0 deletions templates/xdebug3.ini.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
zend_extension=xdebug.so
xdebug.max_nesting_level={{ xdebug_conf_max_nesting_level }}
xdebug.idekey={{ xdebug_conf_idekey }}

; The mode to run xdebug in: https://xdebug.org/docs/all_settings#mode
xdebug.mode={{ xdebug_conf_mode }}

; Connect to the client that made the request (overrides remote_host)
xdebug.discover_client_host={{ xdebug_conf_discover_client_host }}

; How xdebug should be started https://xdebug.org/docs/all_settings#start_with_request
xdebug.start_with_request={{ xdebug_conf_start_with_request }}

; Connect to specified remote host (overridden by discover_client_host)
xdebug.client_host={{ xdebug_conf_client_host }}
xdebug.client_port={{ xdebug_conf_client_port }}

0 comments on commit bf8982f

Please sign in to comment.