@@ -66,7 +66,7 @@ current PHP SAPI:
66
66
67
67
You can also select the output format explicitly defining the
68
68
``VAR_DUMPER_FORMAT `` environment variable and setting its value to either
69
- ``html `` or ``cli ``.
69
+ ``html ``, ``cli `` or :ref: ` server < var-dumper-dump-server-format > `.
70
70
71
71
.. note ::
72
72
@@ -186,6 +186,39 @@ Then you can use the following command to start a server out-of-the-box:
186
186
$ ./vendor/bin/var-dump-server
187
187
[OK] Server listening on tcp://127.0.0.1:9912
188
188
189
+ .. _var-dumper-dump-server-format :
190
+
191
+ Debug any project with the server format
192
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193
+
194
+ There is a way to force the ``VarDumper `` to dump to a server, without the need to configure anything in your
195
+ application: by using the ``VAR_DUMPER_FORMAT=server `` environment variable.
196
+ It is especially useful to debug any project (as soon as the VarDumper component is installed),
197
+ without altering its code by:
198
+
199
+ * starting a server:
200
+
201
+ .. code-block :: terminal
202
+
203
+ $ ./vendor/bin/var-dump-server
204
+
205
+ * running your code with the ``VAR_DUMPER_FORMAT=server `` env variable. For instance, for a CLI command:
206
+
207
+ .. code-block :: terminal
208
+
209
+ $ VAR_DUMPER_FORMAT=server [your-cli-command]
210
+
211
+ .. tip ::
212
+
213
+ If your project loads environment variables from a dotenv file, you can set the ``VAR_DUMPER_FORMAT=server ``
214
+ environment variable in there as well.
215
+
216
+ .. note ::
217
+
218
+ The host used to contact the server when using the ``server `` format is the one configured by the
219
+ ``VAR_DUMPER_SERVER `` var or defaults to ``127.0.0.1:9912 ``.
220
+ But you can configure the host through the ``VAR_DUMPER_FORMAT=tcp://127.0.0.1:1234 `` environment variable as well.
221
+
189
222
DebugBundle and Twig Integration
190
223
--------------------------------
191
224
0 commit comments