@@ -17,48 +17,47 @@ Installation
17
17
18
18
You can install the component in 2 different ways:
19
19
20
- - :doc: `Install it via Composer </components/using_components >` (``symfony/var-dumper `` on `Packagist `_);
21
- - Use the official Git repository (https://github.com/symfony/var-dumper).
20
+ * :doc: `Install it via Composer </components/using_components >` (``symfony/var-dumper `` on `Packagist `_);
21
+ * Use the official Git repository (https://github.com/symfony/var-dumper).
22
22
23
- The dump() function
23
+ The dump() Function
24
24
-------------------
25
25
26
26
The VarDumper component creates a global ``dump() `` function that you can
27
27
use instead of e.g. :phpfunction: `var_dump `. By using it, you'll gain:
28
28
29
- - per object and resource types specialized view to e.g. filter out
29
+ * Per object and resource types specialized view to e.g. filter out
30
30
Doctrine internals while dumping a single proxy entity, or get more
31
- insight on opened files with :phpfunction: `stream_get_meta_data() `.
32
- - configurable output formats: HTML or colored command line output.
33
- - ability to dump internal references, either soft ones (objects or
31
+ insight on opened files with :phpfunction: `stream_get_meta_data() `;
32
+ * Configurable output formats: HTML or colored command line output;
33
+ * Ability to dump internal references, either soft ones (objects or
34
34
resources) or hard ones (``=& `` on arrays or objects properties).
35
35
Repeated occurrences of the same object/array/resource won't appear
36
36
again and again anymore. Moreover, you'll be able to inspect the
37
- reference structure of your data.
38
- - ability to operate in the context of an output buffering handler.
37
+ reference structure of your data;
38
+ * Ability to operate in the context of an output buffering handler.
39
39
40
- ``dump() `` is just a thin wrapper for
41
- :method: `VarDumper::dump() <Symfony\\ Component\\ VarDumper\\ VarDumper::dump> `
42
- so can you also use it directly.
40
+ ``dump() `` is just a thin wrapper and more convenient way to call
41
+ :method: `VarDumper::dump() <Symfony\\ Component\\ VarDumper\\ VarDumper::dump> `.
43
42
You can change the behavior of this function by calling
44
43
:method: `VarDumper::setHandler($callable) <Symfony\\ Component\\ VarDumper\\ VarDumper::setHandler> `:
45
44
calls to ``dump() `` will then be forwarded to ``$callable ``.
46
45
47
- Output format and destination
46
+ Output Format and Destination
48
47
-----------------------------
49
48
50
49
If you read the `advanced documentation <advanced> `, you'll learn how to
51
50
change the format or redirect the output to wherever you want.
52
51
53
52
By default, these are selected based on your current PHP SAPI:
54
53
55
- - on the command line (CLI SAPI), the output is written on ``STDERR ``. This
54
+ * On the command line (CLI SAPI), the output is written on ``STDERR ``. This
56
55
can be surprising to some because this bypasses PHP's output buffering
57
56
mechanism. On the other hand, it give the possibility to easily split
58
- dumps from regular output by using pipe redirection.
59
- - on other SAPIs, dumps are written as HTML on the regular output.
57
+ dumps from regular output by using pipe redirection;
58
+ * On other SAPIs, dumps are written as HTML on the regular output.
60
59
61
- DebugBundle and Twig integration
60
+ DebugBundle and Twig Integration
62
61
--------------------------------
63
62
64
63
The ``DebugBundle `` allows greater integration of the component into the
@@ -76,17 +75,18 @@ or a fatal error occurred, then dumps are written on the regular output.
76
75
In a Twig template, two constructs are available for dumping a variable.
77
76
Choosing between both is mostly a matter of personal taste, still:
78
77
79
- - ``{% dump foo.bar %} `` is the way to go when the original template output
78
+ * ``{% dump foo.bar %} `` is the way to go when the original template output
80
79
shall not be modified: variables are not dumped inline, but in the web
81
- debug toolbar.
82
- - on the contrary, ``{{ dump(foo.bar) }} `` dumps inline and thus may or not
80
+ debug toolbar;
81
+ * on the contrary, ``{{ dump(foo.bar) }} `` dumps inline and thus may or not
83
82
be suited to your use case (e.g. you shouldn't use it in an HTML
84
83
attribute or a ``<script> `` tag).
85
84
86
85
By default for nested variables, dumps are limited to a subset of their
87
86
original value. You can configure the limits in terms of:
88
- - maximum number of items to dump,
89
- - maximum string length before truncation.
87
+
88
+ * maximum number of items to dump,
89
+ * maximum string length before truncation.
90
90
91
91
.. configuration-block ::
92
92
@@ -106,7 +106,7 @@ original value. You can configure the limits in terms of:
106
106
<config max-items =" 250" max-string-length =" -1" />
107
107
</container >
108
108
109
- Reading a dump
109
+ Reading a Dump
110
110
--------------
111
111
112
112
For simple variables, reading the output should be straightforward::
0 commit comments