[ZF-10089] Zend_Log
[zend.git] / documentation / manual / es / module_specs / Zend_Application-CoreFunctionality-Bootstrap_BootstrapAbstract.xml
bloba873a8e821e69949b472e75366529b7fcf113fed
1 <?xml version="1.0" encoding="UTF-8"?>
2     <!-- EN-Revision: 20763 -->
3     <!-- Reviewed: no -->
4 <sect2 id="zend.application.core-functionality.bootstrap-bootstrapabstract">
5     <title>Zend_Application_Bootstrap_BootstrapAbstract</title>
7     <para>
8         <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname>
9         es
10         una clase abstracta que proporciona la base funcional de un arranque
11         (bootstrap) común.
12         Implementa a ambos
13         <link linkend="zend.application.core-functionality.bootstrap-bootstrapper">
14             Zend_Application_Bootstrap_Bootstrapper</link>
15         y a
16         <link linkend="zend.application.core-functionality.bootstrap-resourcebootstrapper">
17             <classname>Zend_Application_Bootstrap_ResourceBootstrapper</classname>
18         </link>
19         .
20     </para>
22     <table id="zend.application.core-functionality.bootstrap-bootstrapabstract.api.table">
23         <title>Métodos de Zend_Application_Bootstrap_BootstrapAbstract</title>
24         <tgroup cols="4">
25             <thead>
26                 <row>
27                     <entry>Método</entry>
28                     <entry>Valor de Retorno</entry>
29                     <entry>Parámetros</entry>
30                     <entry>Descripción</entry>
31                 </row>
32             </thead>
33             <tbody>
34                 <row>
35                     <entry>
36                         <methodname>__construct($application)</methodname>
37                     </entry>
38                     <entry>
39                         <type>void</type>
40                     </entry>
41                     <entry>
42                         <itemizedlist>
43                             <listitem>
44                                 <para>
45                                     <varname>$application</varname>
46                                     :
47                                     <emphasis>requerido</emphasis>
48                                     .
49                                     Acepta tanto a
50                                     <classname>Zend_Application</classname>
51                                     o al
52                                     objeto
53                                     <classname>Zend_Application_Bootstrap_Bootstrapper</classname>
54                                     como único argumento.
55                                 </para>
56                             </listitem>
57                         </itemizedlist>
58                     </entry>
59                     <entry>
60                         <para>
61                             Constructor. Acepta un solo argumento, que debe ser un
62                             objeto
63                             <classname>Zend_Application</classname>
64                             , u otro
65                             objeto bootstrap.
66                         </para>
67                     </entry>
68                 </row>
70                 <row>
71                     <entry>
72                         <methodname>setOptions(array $options)</methodname>
73                     </entry>
74                     <entry>
75                         <classname>Zend_Application_Bootstrap_Bootstrapper</classname>
76                     </entry>
77                     <entry>
78                         <itemizedlist>
79                             <listitem>
80                                 <para>
81                                     <varname>$options</varname>
82                                     :
83                                     <emphasis>requerido</emphasis>
84                                     .
85                                     Array de opciones a establecer.
86                                 </para>
87                             </listitem>
88                         </itemizedlist>
89                     </entry>
90                     <entry>
91                         <para>
92                             Cualquier opción que tiene un setter concordante invocará
93                             ese setter; de lo contrario, la opción será simplemente
94                             almacenada para su recuperación posterior.
95                             Como ejemplo, si su clase extendida definió
96                             un método
97                             <methodname>setFoo()</methodname>
98                             , la opción 'foo'
99                             pasaría el valor a ese método.
100                         </para>
101                         <para>
102                             También pueden usarse dos opciones especiales clave.
103                             <property>pluginPaths</property>
104                             puede ser utilizada para
105                             especificar prefijos de paths para los recursos plugin;
106                             debería ser un array de la clase pares prefijo/path.
107                             <property>resources</property>
108                             puede ser utilizada para
109                             especificar los recursos plugin a utilizar,
110                             y debería estar constituído por pares de opciones plugin
111                             recurso/instanciación.
112                         </para>
113                     </entry>
114                 </row>
116                 <row>
117                     <entry>
118                         <methodname>getOptions()</methodname>
119                     </entry>
120                     <entry>
121                         <type>array</type>
122                     </entry>
123                     <entry>N/A</entry>
124                     <entry>
125                         <para>
126                             Devuelve todas las opciones registradas via
127                             <methodname>setOptions()</methodname>
128                             .
129                         </para>
130                     </entry>
131                 </row>
133                 <row>
134                     <entry>
135                         <methodname>hasOption($key)</methodname>
136                     </entry>
137                     <entry>
138                         <type>boolean</type>
139                     </entry>
140                     <entry>
141                         <itemizedlist>
142                             <listitem>
143                                 <para>
144                                     <varname>$key</varname>
145                                     :
146                                     <emphasis>requerido</emphasis>
147                                     .
148                                     Clave de opción a probar.
149                                 </para>
150                             </listitem>
151                         </itemizedlist>
152                     </entry>
153                     <entry>
154                         <para>Determinar si una opción clave está presente.</para>
155                     </entry>
156                 </row>
158                 <row>
159                     <entry>
160                         <methodname>getOption($key)</methodname>
161                     </entry>
162                     <entry>
163                         <type>mixed</type>
164                     </entry>
165                     <entry>
166                         <itemizedlist>
167                             <listitem>
168                                 <para>
169                                     <varname>$key</varname>
170                                     :
171                                     <emphasis>requerido</emphasis>
172                                     .
173                                     Clave de opción para recuperar.
174                                 </para>
175                             </listitem>
176                         </itemizedlist>
177                     </entry>
178                     <entry>
179                         <para>
180                             Recuperar el valor asociado con una opción clave;
181                             retorna
182                             <constant>NULL</constant>
183                             si ninguna opción está registrada con
184                             esa clave.
185                         </para>
186                     </entry>
187                 </row>
189                 <row>
190                     <entry>
191                         <methodname>setApplication(Zend_Application |
192                             Zend_Application_Bootstrap_Bootstrapper $application)
193                         </methodname>
194                     </entry>
195                     <entry>
196                         <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname>
197                     </entry>
198                     <entry>
199                         <itemizedlist>
200                             <listitem>
201                                 <para>
202                                     <varname>$application</varname>
203                                     :
204                                     <emphasis>requerido</emphasis>
205                                     .
206                                 </para>
207                             </listitem>
208                         </itemizedlist>
209                     </entry>
210                     <entry>
211                         <para>
212                             Registrar al objeto padre de la aplicación o en el bootstrap.
213                    </para>
214                     </entry>
215                 </row>
217                 <row>
218                     <entry>
219                         <methodname>getApplication()</methodname>
220                     </entry>
221                     <entry>
222                         <classname>Zend_Application |
223                             Zend_Application_Bootstrap_Bootstrapper</classname>
224                     </entry>
225                     <entry>N/A</entry>
226                     <entry>
227                         <para>
228                             Recuperar el objeto aplicación/bootstrap pasado via
229                             constructor.
230                    </para>
231                     </entry>
232                 </row>
234                 <row>
235                     <entry>
236                         <methodname>getEnvironment()</methodname>
237                     </entry>
238                     <entry>
239                         <type>string</type>
240                     </entry>
241                     <entry>N/A</entry>
242                     <entry>
243                         <para>
244                             Recuperar el string del entorno registrado
245                             con el objeto padre de la aplicación o del bootstrap.
246                    </para>
247                     </entry>
248                 </row>
250                 <row>
251                     <entry>
252                         <methodname>getClassResources()</methodname>
253                     </entry>
254                     <entry>
255                         <type>array</type>
256                     </entry>
257                     <entry>N/A</entry>
258                     <entry>
259                         <para>
260                             Recuperar una lista de los recursos inicializadores de
261                             nombres disponibles con los fueron definidos en la clase.
262                             Esto puede ser de implementación específica.
263                    </para>
264                     </entry>
265                 </row>
267                 <row>
268                     <entry>
269                         <methodname>getContainer()</methodname>
270                     </entry>
271                     <entry>
272                         <type>object</type>
273                     </entry>
274                     <entry>N/A</entry>
275                     <entry>
276                         <para>
277                             Recupera el contenedor que almacena recursos.
278                             Si no hay un contenedor actualmente registrado,
279                             registra una instancia
280                             <link linkend="zend.registry">Zend_Registry</link>
281                             antes de retornarlo.
282                         </para>
283                     </entry>
284                 </row>
286                 <row>
287                     <entry>
288                         <methodname>setContainer($container)</methodname>
289                     </entry>
290                     <entry>
291                         <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname>
292                     </entry>
293                     <entry>
294                         <itemizedlist>
295                             <listitem>
296                                 <para>
297                                     <varname>$container</varname>
298                                     ,
299                                     <emphasis>requerido</emphasis>
300                                     .
301                                     Un objeto en el cual almacenar recursos.
302                                 </para>
303                             </listitem>
304                         </itemizedlist>
305                     </entry>
306                     <entry>
307                         <para>
308                             Proporciona un contenedor en el que se almacenan recursos.
309                             Cuando un método de recurso o plugin devuelve un valor,
310                             será almacenado en este contenedor para su recuperación
311                             posterior.
312                    </para>
313                     </entry>
314                 </row>
316                 <row>
317                     <entry>
318                         <methodname>hasResource($name)</methodname>
319                     </entry>
320                     <entry>
321                         <type>boolean</type>
322                     </entry>
323                     <entry>
324                         <itemizedlist>
325                             <listitem>
326                                 <para>
327                                     <varname>$name</varname>
328                                     ,
329                                     <emphasis>requerido</emphasis>
330                                     .
331                                     Nombre del recurso a comprobar.
332                                 </para>
333                             </listitem>
334                         </itemizedlist>
335                     </entry>
336                     <entry>
337                         <para>
338                             Cuando un método de recurso o plugin devuelve un valor,
339                             será almacenado en el contenedor de recursos (ver
340                             <methodname>getContainer()</methodname>
341                             y
342                             <methodname>setContainer()</methodname>
343                             . Este método indicará si
344                             se ha establecido o no un valor para ese recurso.
345                         </para>
346                     </entry>
347                 </row>
349                 <row>
350                     <entry>
351                         <methodname>getResource($name)</methodname>
352                     </entry>
353                     <entry>
354                         <type>mixed</type>
355                     </entry>
356                     <entry>
357                         <itemizedlist>
358                             <listitem>
359                                 <para>
360                                     <varname>$name</varname>
361                                     ,
362                                     <emphasis>requerido</emphasis>
363                                     .
364                                     Nombre del recurso a recuperar.
365                                 </para>
366                             </listitem>
367                         </itemizedlist>
368                     </entry>
369                     <entry>
370                         <para>
371                             Cuando un método de recurso o plugin devuelve un valor,
372                             será almacenado en el contenedor de recursos (ver
373                             <methodname>getContainer()</methodname>
374                             y
375                             <methodname>setContainer()</methodname>
376                             . Este método recuperará
377                             recursos del contenedor.
378                         </para>
379                     </entry>
380                 </row>
382                 <row>
383                     <entry>
384                         <methodname>bootstrap($resource = null)</methodname>
385                     </entry>
386                     <entry>
387                         <type>mixed</type>
388                     </entry>
389                     <entry>
390                         <itemizedlist>
391                             <listitem>
392                                 <para>
393                                     <varname>$resource</varname>
394                                     :
395                                     <emphasis>opcional</emphasis>
396                                     .
397                                 </para>
398                             </listitem>
399                         </itemizedlist>
400                     </entry>
401                     <entry>
402                         <para>
403                             Si
404                             <varname>$resource</varname>
405                             está vacío, ejecutar todos
406                             los recursos del bootstrap.
407                             Si es un string, ejecutar ese único recurso;
408                             si es un array, ejecutar cada recurso del array.
409                         </para>
411                         <para>
412                             Este método puede ser utilizado para ejecutar
413                             bootstraps individuales, ya hayan sido definidos en la
414                             propia clase o mediante clases de recursos de plugin.
415                             Un recurso definido en la clase será ejecutado en
416                             preferencia por sobre un recurso de plugin en el caso
417                             de conflicto de nombres.
418                    </para>
419                     </entry>
420                 </row>
422                 <row>
423                     <entry>
424                         <methodname>run()</methodname>
425                     </entry>
426                     <entry>
427                         <type>void</type>
428                     </entry>
429                     <entry>N/A</entry>
430                     <entry>
431                         <para>
432                             Define qué lógica de aplicación ejecutar luego del
433                             bootstrap.
434                    </para>
435                     </entry>
436                 </row>
438                 <row>
439                     <entry>
440                         <methodname>__call($method, $args)</methodname>
441                     </entry>
442                     <entry>
443                         <type>mixed</type>
444                     </entry>
445                     <entry>
446                         <itemizedlist>
447                             <listitem>
448                                 <para>
449                                     <varname>$method</varname>
450                                     :
451                                     <emphasis>requerido</emphasis>
452                                     .
453                                     El nombre del método a llamar.
454                                 </para>
455                             </listitem>
457                             <listitem>
458                                 <para>
459                                     <varname>$args</varname>
460                                     :
461                                     <emphasis>requerido</emphasis>
462                                     .
463                                     Array de argumentos para usar en el método de llamada.
464                                 </para>
465                             </listitem>
466                         </itemizedlist>
467                     </entry>
468                     <entry>
469                         <para>
470                             Ofrece comodidad para bootstrapping de recursos
471                             individuales permitiéndole llamar
472                             'bootstrap&lt;ResourceName&gt;()' en vez de usar el
473                             método
474                             <methodname>bootstrap()</methodname>
475                             .
476                         </para>
477                     </entry>
478                 </row>
479             </tbody>
480         </tgroup>
481     </table>
482 </sect2>