-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathdebug-backtrace.xml
281 lines (271 loc) · 7.47 KB
/
debug-backtrace.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 9fad144a4f011519dfe3f5a4b8c522083b7c4489 Maintainer: yago Status: ready -->
<refentry xml:id="function.debug-backtrace" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>debug_backtrace</refname>
<refpurpose>Genera un rastreo</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>debug_backtrace</methodname>
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>DEBUG_BACKTRACE_PROVIDE_OBJECT</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>limit</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<function>debug_backtrace</function> genera un rastreo de PHP.
</para>
</refsect1>
<refsect1 role="parameters"><!-- {{{ -->
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
Desde 5.3.6, este parámetro es una mascara de bits para las siguientes opciones:
<table>
<title><function>debug_backtrace</function> options</title>
<tgroup cols="2">
<tbody>
<row>
<entry>DEBUG_BACKTRACE_PROVIDE_OBJECT</entry>
<entry>
Completar el índice "object" o no.
</entry>
</row>
<row>
<entry>DEBUG_BACKTRACE_IGNORE_ARGS</entry>
<entry>
Omitir el índice "args" y por lo tanto todos los argumentos de las funciones/métodos para
ahorrar memoria o no.
</entry>
</row>
</tbody>
</tgroup>
</table>
Antes de 5.3.6, el único valor reconocido es &true; o &false;, que es lo mismo que
establecer y desestablecer la opción <constant>DEBUG_BACKTRACE_PROVIDE_OBJECT</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>limit</parameter></term>
<listitem>
<para>
Desde 5.4.0, este parámetro puede ser usado para limitar el número de stack frames que se muestran.
Por defecto (<parameter>limit</parameter>=<literal>0</literal>) imprime todos los stack frames.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1><!-- }}} -->
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Devuelve un array de <type>array</type> asociativos. Los posibles elementos devueltos
son los siguientes:
</para>
<para>
<table>
<title>Posibles elementos devueltos por <function>debug_backtrace</function></title>
<tgroup cols="3">
<thead>
<row>
<entry>&Name;</entry>
<entry>&Type;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>function</entry>
<entry><type>string</type></entry>
<entry>
El nombre de la función actual. Véase también
<link linkend="language.constants.predefined">__FUNCTION__</link>.
</entry>
</row>
<row>
<entry>line</entry>
<entry><type>integer</type></entry>
<entry>
El número de línea actual. Véase también
<link linkend="language.constants.predefined">__LINE__</link>.
</entry>
</row>
<row>
<entry>file</entry>
<entry><type>string</type></entry>
<entry>
El nombre de archivo actual. Véase también
<link linkend="language.constants.predefined">__FILE__</link>.
</entry>
</row>
<row>
<entry>class</entry>
<entry><type>string</type></entry>
<entry>
El nombre de la <link linkend="language.oop5">clase</link> actual. Véase también
<link linkend="language.constants.predefined">__CLASS__</link>
</entry>
</row>
<row>
<entry>object</entry>
<entry><type>object</type></entry>
<entry>
El <link linkend="language.oop5">objeto</link> actual.
</entry>
</row>
<row>
<entry>type</entry>
<entry><type>string</type></entry>
<entry>
El tipo de llamada actual. Si es una llamada a un método devuelve "->". Si es una llamada
a un método estático devuelve "::". Si es una llamada a una función no se devuelve nada.
</entry>
</row>
<row>
<entry>args</entry>
<entry><type>array</type></entry>
<entry>
Dentro de una función se lista los argumentos de la función.
Dentro de un archvo incluido se lista el nombre (o nombres) del archivo incluido.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.4.0</entry>
<entry>
Añadido el parámetro opcional <parameter>limit</parameter>.
</entry>
</row>
<row>
<entry>5.3.6</entry>
<entry>
Se cambió el parámetro <parameter>provide_object</parameter> a <parameter>options</parameter> y se añadió la
opción adicional <constant>DEBUG_BACKTRACE_IGNORE_ARGS</constant>.
</entry>
</row>
<row>
<entry>5.2.5</entry>
<entry>
Se añadió el parámetro opcional <parameter>provide_object</parameter>.
</entry>
</row>
<row>
<entry>5.1.1</entry>
<entry>
Se añadió el <type>object</type> actual como posible elemento devuelto.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de <function>debug_backtrace</function></title>
<programlisting role="php">
<![CDATA[
<?php
// nombre de archivo: /tmp/a.php
function una_prueba($str)
{
echo "\nHola: $str";
var_dump(debug_backtrace());
}
una_prueba('amigo');
?>
<?php
// nombre de archivo: /tmp/b.php
include_once '/tmp/a.php';
?>
]]>
</programlisting>
<para>
El resultado es similar al siguiente cuando se ejecuta
<filename>/tmp/b.php</filename>:
</para>
<screen>
<![CDATA[
Hola: amigo
array(2) {
[0]=>
array(4) {
["file"] => string(10) "/tmp/a.php"
["line"] => int(10)
["function"] => string(10) "una_prueba"
["args"]=>
array(1) {
[0] => &string(5) "amigo"
}
}
[1]=>
array(4) {
["file"] => string(10) "/tmp/b.php"
["line"] => int(2)
["args"] =>
array(1) {
[0] => string(10) "/tmp/a.php"
}
["function"] => string(12) "include_once"
}
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>trigger_error</function></member>
<member><function>debug_print_backtrace</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->