File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,15 @@ current PHP SAPI:
64
64
mechanism;
65
65
* On other SAPIs, dumps are written as HTML in the regular output.
66
66
67
+ .. tip ::
68
+
69
+ You can also select the output format explicitly defining the
70
+ ``VAR_DUMPER_FORMAT `` environment variable and setting its value to either
71
+ ``html `` or ``cli ``.
72
+
73
+ .. versionadded :: 4.2
74
+ The ``VAR_DUMPER_FORMAT `` env var was introduced in Symfony 4.2.
75
+
67
76
.. note ::
68
77
69
78
If you want to catch the dump output as a string, please read the
@@ -122,14 +131,14 @@ the :ref:`dump_destination option <configuration-debug-dump_destination>` of the
122
131
Outside a Symfony application, use the ``ServerDumper `` class::
123
132
124
133
require __DIR__.'/vendor/autoload.php';
125
-
134
+
126
135
use Symfony\Component\VarDumper\VarDumper;
127
136
use Symfony\Component\VarDumper\Cloner\VarCloner;
128
137
use Symfony\Component\VarDumper\Dumper\ServerDumper;
129
-
138
+
130
139
VarDumper::setHandler(function ($var) {
131
140
$cloner = new VarCloner();
132
- $dumper = new ServerDumper('tcp://127.0.0.1:9912');
141
+ $dumper = new ServerDumper('tcp://127.0.0.1:9912');
133
142
$dumper->dump($cloner->cloneVar($var));
134
143
});
135
144
You can’t perform that action at this time.
0 commit comments