Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"port": 9003,
"pathMappings": {
"/buildkit/build": "${workspaceRoot}/build"
},
Expand Down
4 changes: 4 additions & 0 deletions civicrm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ COPY --chown=buildkit:buildkit amp.services.yml /buildkit/.amp/services.yml

COPY buildkit.ini /usr/local/etc/php/conf.d/buildkit.ini

COPY php.ini /usr/local/etc/php/php.ini

COPY php-cli.ini /usr/local/etc/php/php-cli.ini

COPY msmtprc /etc/msmtprc

COPY apache.conf /etc/apache2/conf-enabled/buildkit.conf
Expand Down
11 changes: 8 additions & 3 deletions civicrm/buildkit.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ cgi.fix_pathinfo = Off
sendmail_path=/usr/sbin/sendmail -t -i
log_errors = On
error_log = /dev/stderr
xdebug.show_error_trace = On
xdebug.remote_enable = On
xdebug.remote_autostart = 1

zend_extension=xdebug.so
xdebug.output_dir=/debug
xdebug.var_display_max_depth = 8
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024
max_execution_time=600
xdebug.show_error_trace = On
30 changes: 15 additions & 15 deletions civicrm/docker-civicrm-entrypoint
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/bin/sh
#!/bin/bash
set -e

# xdebug setup
CONTAINER_IP=`/sbin/ip route|awk '/default/ { print $3 }'`
cat << EOF > /usr/local/etc/php/conf.d/debug.ini
zend_extension=xdebug.so
xdebug.show_error_trace=1
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/debug
xdebug.var_display_max_depth = 8
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024
xdebug.remote_host=${CONTAINER_IP}
max_execution_time=600
XDEBUG_CLIENT=""

# Check if docker host available
if getent hosts host.docker.internal > /dev/null
then
XDEBUG_CLIENT="host.docker.internal"
else
# use gateway
XDEBUG_CLIENT=`/sbin/ip route|awk '/default/ { print $3 }'`
fi

cat << EOF > /usr/local/etc/php/conf.d/99-debug-host.ini
xdebug.client_host=${XDEBUG_CLIENT}
EOF


# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
Expand Down
1 change: 1 addition & 0 deletions civicrm/php-cli.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xdebug.mode=off
3 changes: 3 additions & 0 deletions civicrm/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.show_error_trace=1
4 changes: 4 additions & 0 deletions publish/templates/civicrm/Dockerfile.twig
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ COPY --chown=buildkit:buildkit amp.services.yml /buildkit/.amp/services.yml

COPY buildkit.ini /usr/local/etc/php/conf.d/buildkit.ini

COPY php.ini /usr/local/etc/php/php.ini

COPY php-cli.ini /usr/local/etc/php/php-cli.ini

COPY msmtprc /etc/msmtprc

COPY apache.conf /etc/apache2/conf-enabled/buildkit.conf
Expand Down
11 changes: 8 additions & 3 deletions publish/templates/civicrm/buildkit.ini.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ cgi.fix_pathinfo = Off
sendmail_path=/usr/sbin/sendmail -t -i
log_errors = On
error_log = /dev/stderr
xdebug.show_error_trace = On
xdebug.remote_enable = On
xdebug.remote_autostart = 1

zend_extension=xdebug.so
xdebug.output_dir=/debug
xdebug.var_display_max_depth = 8
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024
max_execution_time=600
xdebug.show_error_trace = On
29 changes: 14 additions & 15 deletions publish/templates/civicrm/docker-civicrm-entrypoint.twig
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#!/bin/sh
#!/bin/bash
set -e

# xdebug setup
CONTAINER_IP=`/sbin/ip route|awk '/default/ { print $3 }'`
cat << EOF > /usr/local/etc/php/conf.d/debug.ini
zend_extension=xdebug.so
xdebug.show_error_trace=1
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/debug
xdebug.var_display_max_depth = 8
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024
xdebug.remote_host=${CONTAINER_IP}
max_execution_time=600
XDEBUG_CLIENT=""

# Check if docker host available
if getent hosts host.docker.internal > /dev/null
then
XDEBUG_CLIENT="host.docker.internal"
else
# use gateway
XDEBUG_CLIENT=`/sbin/ip route|awk '/default/ { print $3 }'`
fi

cat << EOF > /usr/local/etc/php/conf.d/99-debug-host.ini
xdebug.client_host=${XDEBUG_CLIENT}
EOF

# first arg is `-f` or `--some-option`
Expand Down
1 change: 1 addition & 0 deletions publish/templates/civicrm/php-cli.ini.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xdebug.mode=off
3 changes: 3 additions & 0 deletions publish/templates/civicrm/php.ini.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.show_error_trace=1