You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-27Lines changed: 38 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ between your PHP file and the proxy class.
16
16
Build your own
17
17
--------------
18
18
19
+
When you just want to use this inside Docker you probably want to scroll further down and skip until you reach the **Use with Docker** part. No need to build it on your host machine yourself.
20
+
19
21
# Get the dependecies
20
22
go get
21
23
# Build
@@ -43,57 +45,66 @@ Show help
43
45
Use with Docker
44
46
---------------
45
47
46
-
Use the [official docker image](https://hub.docker.com/r/dfeyer/flow-debugproxy/) and follow the instruction for the configuration.
47
-
48
-
##### PHP configuration
48
+
Make sure xdebug is installed in your dev container. You can use drydock for this or add the following to your development Dockerfile
49
49
50
50
```
51
-
[Xdebug]
52
-
zend_extension=/.../xdebug.so
53
-
xdebug.remote_enable=1
54
-
xdebug.idekey=PHPSTORM
55
-
; The IP or name of the proxy container
56
-
xdebug.remote_host=debugproxy
57
-
; The proxy port (9010 by default, to not have issue is you use PHP FPM, already on port 9000)
58
-
xdebug.remote_port=9010
59
-
;xdebug.remote_log=/tmp/xdebug.log
51
+
# install xdebug
52
+
RUN yes | pecl install xdebug
53
+
RUN echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini
60
54
```
55
+
#### Docker Compose
61
56
62
-
You can use the `xdebug.remote_log` to debug the protocol between your container and the proxy, it's useful to catch network issues.
63
-
64
-
##### Docker Compose
65
-
66
-
This is an incomplete Docker Compose configuration:
57
+
This is an incomplete Docker Compose configuration showing all relevant settings for the debugproxy:
67
58
68
59
```
69
60
services:
61
+
neos:
62
+
...
63
+
volume:
64
+
70
65
debugproxy:
71
66
image: dfeyer/flow-debugproxy:latest
72
67
volumes:
73
-
- .:/data
68
+
- neos_data_tempory:/neos/Data/Temporary:ro
74
69
environment:
75
70
# This MUST be the IP address of the IDE (your computer)
76
-
- "IDE_IP=192.168.1.130"
77
-
# This is the default value, need to match the xdebug.remote_port on your php.ini
78
-
- "XDEBUG_PORT=9010"
71
+
IDE_PORT: 9003
72
+
# This is the default value, need to match the xdebug.client_port and FLOW_CONTEXT environment variable
# Use this to enable verbose debugging on the proxy
80
-
# - "ADDITIONAL_ARGS=-vv --debug"
77
+
#ADDITIONAL_ARGS: "-vv --debug"
81
78
networks:
82
79
- backend
83
80
84
81
# This is your application containers, you need to link it to the proxy
85
82
app:
86
83
# The proxy need an access to the project files, to be able to do the path mapping
84
+
# make sure the path is the one actually used by neos and exists in the container
85
+
# if it is created by this command neos won't be able to write any temporary cache data due to right issues!
87
86
volumes:
88
-
- .:/data
89
-
links:
90
-
- debugproxy
87
+
neos_data_tempory:/app/Data/Temporary:rw,cached
88
+
89
+
volumes:
90
+
neos_data_temporary: {}
91
91
```
92
92
93
+
When running the debugger make sure to include interpreter options for xdebug to tell it about your debug proxy. For example using the above compose file when debugging a test in the Docker/Testing context you would use:
**Depending on your IDE set this setting as late as possible!**
100
+
101
+
IntelliJ/PHPStorm for example set these command line options on their own, overriding them if you set them in your xdebug.ini. You will need to add them to the configuration of each actual test to make sure these settings have precedence!
102
+
93
103
**Options summary:**
94
-
*`IDE_IP` The primary local W-/LAN IP of your machine where your IDE runs on
104
+
*`IDE_IP` The primary local W-/LAN IP of your machine where your IDE runs on, defaults to docker.host.internal
95
105
*`IDE_PORT` The Port your IDE is listening for incoming xdebug connections. (The port the debug proxy will try to connect to)
96
-
*`XDEBUG_PORT` The port on which xdebug will try to establish a connection (to this container)
106
+
*`XDEBUG` The flow context to port mapping. Based on the port xdebug connects to the context will be determined by this container
107
+
*`LOCAL_ROOT` The path where the Data/Temporary directory will be mounted to. Used to determine the path mapping
97
108
*`FRAMEWORK` Currently supported values: `flow` and `dummy`
98
109
*`ADDITIONAL_ARGS` For any additional argument like verbosity flags (`-vv`) or debug mode (`--debug`) (or both)
0 commit comments