Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit b5789fc

Browse files
committed
Update php-xdebug role to latest version.
1 parent aedfc16 commit b5789fc

File tree

10 files changed

+63
-41
lines changed

10 files changed

+63
-41
lines changed

provisioning/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
- src: geerlingguy.php-versions
5959
version: 2.0.0
6060
- src: geerlingguy.php-xdebug
61-
version: 2.3.1
61+
version: 2.4.0
6262
- src: geerlingguy.php-xhprof
6363
version: 2.2.2
6464
- src: geerlingguy.pimpmylog
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.DS_Store
1+
*.retry
2+
tests/test.sh

provisioning/roles/geerlingguy.php-xdebug/.travis.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,23 @@ services: docker
33

44
env:
55
- distro: centos7
6-
init: /usr/lib/systemd/systemd
7-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
86
- distro: ubuntu1604
9-
init: /lib/systemd/systemd
10-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
117
- distro: debian8
12-
init: /lib/systemd/systemd
13-
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
14-
15-
before_install:
16-
# Pull container.
17-
- 'docker pull geerlingguy/docker-${distro}-ansible:latest'
188

199
script:
20-
- container_id=$(mktemp)
21-
# Run container in detached state.
22-
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"'
23-
24-
# Install dependencies.
25-
- 'docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml'
26-
27-
# Ansible syntax check.
28-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check'
10+
# Configure test script so we can run extra tests after playbook is run.
11+
- export container_id=$(date +%s)
12+
- export cleanup=false
2913

30-
# Test role.
31-
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml'
14+
# Download test shim.
15+
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
16+
- chmod +x ${PWD}/tests/test.sh
3217

33-
# Test role idempotence.
34-
- idempotence=$(mktemp)
35-
- docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence}
36-
- >
37-
tail ${idempotence}
38-
| grep -q 'changed=0.*failed=0'
39-
&& (echo 'Idempotence test: pass' && exit 0)
40-
|| (echo 'Idempotence test: fail' && exit 1)
18+
# Run tests.
19+
- ${PWD}/tests/test.sh
4120

4221
# Run script to test if Xdebug is available and working.
43-
- 'docker exec "$(cat ${container_id})" env TERM=xterm php /etc/ansible/roles/role_under_test/tests/xdebug-test.php'
22+
- 'docker exec ${container_id} env TERM=xterm php /etc/ansible/roles/role_under_test/tests/xdebug-test.php'
4423

4524
notifications:
4625
webhooks: https://galaxy.ansible.com/api/v1/notifications/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Jeff Geerling
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

provisioning/roles/geerlingguy.php-xdebug/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Available variables are listed below, along with default values (see `defaults/m
1616

1717
Where Xdebug setup files will be downloaded and built.
1818

19-
php_xdebug_version: 2.4.1
19+
php_xdebug_version: 2.5.0
2020

2121
The version of Xdebug to be installed (see [Updates](https://xdebug.org/updates.php) for a current listing).
2222

@@ -25,10 +25,6 @@ The version of Xdebug to be installed (see [Updates](https://xdebug.org/updates.
2525

2626
Whether to enable XDebug coverage and default exception handling or not. Disable these for slightly improved PHP performance, enable these to use XDebug to the fullest extent.
2727

28-
php_xdebug_cli_enable: 1
29-
30-
Whether xdebug is enabled for the CLI.
31-
3228
php_xdebug_module_path: /usr/lib64/php/modules
3329

3430
The path where `xdebug.so` will be installed.
@@ -54,10 +50,14 @@ The location of the xdebug log (useful if you're having trouble connecting).
5450

5551
The IDE key to use in the URL when making Xdebug requests (e.g. `http://example.local/?XDEBUG_SESSION_START=sublime.xdebug`).
5652

57-
php_xdebug_max_nesting_level: 100
53+
php_xdebug_max_nesting_level: 256
5854

5955
The maximimum function nesting level before Xdebug bails and throws a fatal exception.
6056

57+
php_xdebug_cli_disable: no
58+
59+
(Debian/Ubuntu ONLY) Disable xdebug for the CLI SAPI.
60+
6161
## Dependencies
6262

6363
- geerlingguy.php

provisioning/roles/geerlingguy.php-xdebug/defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ php_xdebug_version: 2.5.0
55

66
php_xdebug_coverage_enable: 1
77
php_xdebug_default_enable: 1
8-
php_xdebug_cli_enable: 1
98

109
php_xdebug_remote_enable: "false"
1110
php_xdebug_remote_connect_back: "false"
@@ -18,3 +17,5 @@ php_xdebug_idekey: sublime.xdebug
1817

1918
php_xdebug_max_nesting_level: 256
2019

20+
# Only used on Debian/Ubuntu.
21+
php_xdebug_cli_disable: no

provisioning/roles/geerlingguy.php-xdebug/meta/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
dependencies: []
2+
dependencies:
3+
- geerlingguy.php
34

45
galaxy_info:
56
author: geerlingguy

provisioning/roles/geerlingguy.php-xdebug/tasks/configure.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
owner: root
77
group: root
88
mode: 0644
9+
when: "'cli' not in item or ('cli' in item and not php_xdebug_cli_disable)"
910
with_items: "{{ php_extension_conf_paths }}"
1011
notify:
1112
- restart webserver
1213
- restart php-fpm
14+
15+
- name: Disable xdebug for PHP CLI.
16+
file:
17+
path: "/etc/php/{{ php_version }}/cli/conf.d/{{ php_xdebug_config_filename }}"
18+
state: absent
19+
when: ansible_os_family == 'Debian' and php_xdebug_cli_disable
20+
notify:
21+
- restart webserver
22+
- restart php-fpm

provisioning/roles/geerlingguy.php-xdebug/templates/xdebug.ini.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ xdebug.remote_enable={{ php_xdebug_remote_enable }}
88
xdebug.remote_connect_back={{ php_xdebug_remote_connect_back }}
99
xdebug.remote_host={{ php_xdebug_remote_host }}
1010
xdebug.remote_port={{ php_xdebug_remote_port }}
11-
xdebug.remote_handler=dbgp
1211
xdebug.remote_log={{ php_xdebug_remote_log }}
1312
xdebug.remote_autostart={{ php_xdebug_remote_autostart }}
1413

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ansible Role tests
2+
3+
To run the test playbook(s) in this directory:
4+
5+
1. Install and start Docker.
6+
1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`:
7+
- `wget -O tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/`
8+
1. Make the test shim executable: `chmod +x tests/test.sh`.
9+
1. Run (from the role root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh`
10+
11+
If you don't want the container to be automatically deleted after the test playbook is run, add the following environment variables: `cleanup=false container_id=$(date +%s)`

0 commit comments

Comments
 (0)