Skip to content

Commit 3f1e537

Browse files
authored
Merge pull request #22 from vertexvaar/master
TASK: Add a detailed documentation on how to run the flow-debugproxy in docker containers
2 parents eb89094 + 09c0d20 commit 3f1e537

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,43 @@ Show help
4343
Use with Docker
4444
---------------
4545

46+
##### 1. Preparation:
47+
48+
You will need:
49+
1. Your (W)LAN IP address.
50+
2. Your docker-machine's IP address. CMD: `docker-machine ip default` (use 127.0.0.1 on linux)
51+
3. A compiled flow-debugproxy binary
52+
4. Access to the PHP container's php.ini
53+
5. xdebug must be working
54+
55+
##### 2. Installation & Debugging:
56+
57+
1. Copy the flow-debugproxy binary to your container or a mounted folder.
58+
2. Identify and set these environment variables or replace them in the upcoming commands:
59+
* `HOST_IP` (Primary (W)LAN address of your device)
60+
* `XDEBUG_PORT` (PhpStorm settings: Language & Framework -> PHP -> Debug: Xdebug: Debug Port)
61+
* `FLOW_DEBUG_BIN_PATH` (The path of the binary **inside** the container)
62+
3. Set following php.ini values in your php/web container: (xdebug will now try to (only) connect to the php container itself.)
63+
```
64+
xdebug.remote_host = 127.0.0.1
65+
xdebug.remote_port = 9002
66+
```
67+
4. Start the debug proxy (Replace `$(docker-compose ps -q app)` with your container if you don't use docker-compose)
68+
```
69+
docker exec -e PHP_IDE_CONFIG='serverName=app' $(docker-compose ps -q app) ${FLOW_DEBUG_BIN_PATH} --xdebug 0.0.0.0:9002 --ide ${HOST_IP}:${XDEBUG_PORT} > /dev/null &
70+
```
71+
5. Enable your IDE's xdebug listener, ensure xdebug is enabled (e.g. if you use bookm)
72+
6. Use `xdebug_break()` in your code to force your first break.
73+
7. The first time you have to configure your IDE with the popup that should open on the first `xdebug_break();` hit. (Or "Click to set up path mappings" in your debug console UI)
74+
If not, configure your PHP Server settings yourself.
75+
76+
Debugging the debugger:
77+
78+
Start the debug proxy with verbose flags if it does not connect to your IDE.
79+
The debug proxy does not quit after stopping the process that started it. You have to kill it in the container manually.
80+
81+
Hint:
82+
4683
If you use the env variable `FLOW_PATH_TEMPORARY_BASE`, please be sure to keep
4784
`Data/Temporary` inside the path, without this the mapper will not detect the
4885
proxy classes.
@@ -51,6 +88,13 @@ proxy classes.
5188
FLOW_PATH_TEMPORARY_BASE=/tmp/flow/Data/Temporary
5289
```
5390

91+
##### Using with --framework dummy
92+
93+
If your debugging target is the code generated by Flow's AOP Framework then you can start the debugging proxy with --framework dummy
94+
In that case it won't remap from the generated code to your source but "pass through" the debugger steps.
95+
To see what's going on you have to have the generated code in a folder visible to your IDE (in your project).
96+
You can either abstain from `FLOW_PATH_TEMPORARY_BASE` or set it to a path that is in your IDE's project.
97+
5498
Acknowledgments
5599
---------------
56100

0 commit comments

Comments
 (0)