[ZF-10089] Zend_Log
[zend.git] / documentation / manual / es / module_specs / Zend_Application-CoreFunctionality-Application.xml
blob2722278b6839b2d849faa7af8f4b7568e9db7c7e
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- EN-Revision: 21357 -->
3 <!-- Reviewed: no -->
4 <sect2 id="zend.application.core-functionality.application">
5     <title>Zend_Application</title>
7     <para>
8         <classname>Zend_Application</classname>
9         proporciona la funcionalidad
10         básica del componente, y el punto de entrada a su aplicación
11         Zend Framework. Su propósito es doble: para configurar el medio ambiente
12         <acronym>PHP</acronym>
13         (incluyendo autocarga), y ejecutar su aplicación bootstrap.
14     </para>
16     <table id="zend.application.core-functionality.application.api.options">
17         <title>Zend_Application options</title>
18         <tgroup cols="2">
19             <thead>
20                 <row>
21                     <entry>Option</entry>
22                     <entry>Description</entry>
23                 </row>
24             </thead>
25             <tbody>
26                 <row>
27                     <entry>
28                         <emphasis>
29                             <property>phpSettings</property>
30                         </emphasis>
31                     </entry>
32                     <entry>
33                         <para>
34                             Array of
35                             <filename>php.ini</filename>
36                             settings to use. Keys should be the
37                             <filename>php.ini</filename>
38                             keys.
39                         </para>
40                     </entry>
41                 </row>
43                 <row>
44                     <entry>
45                         <emphasis>
46                             <property>includePaths</property>
47                         </emphasis>
48                     </entry>
49                     <entry>
50                         <para>
51                             Additional paths to prepend to the
52                             <emphasis>include_path</emphasis>
53                             . Should be an array of paths.
54                         </para>
55                     </entry>
56                 </row>
58                 <row>
59                     <entry>
60                         <emphasis>
61                             <property>autoloaderNamespaces</property>
62                         </emphasis>
63                     </entry>
64                     <entry>
65                         <para>
66                             Array of additional namespaces to register with the
67                             <classname>Zend_Loader_Autoloader</classname>
68                             instance.
69                         </para>
70                     </entry>
71                 </row>
73                 <row>
74                     <entry>
75                         <emphasis>
76                             <property>bootstrap</property>
77                         </emphasis>
78                     </entry>
79                     <entry>
80                         <para>
81                             Either the string path to the bootstrap class, or an array
82                             with elements for the 'path' and 'class' for the application
83                             bootstrap.
84                         </para>
85                     </entry>
86                 </row>
87             </tbody>
88         </tgroup>
89     </table>
91     <note>
92         <title>Option names</title>
94         <para>
95             Please note that option names are case insensitive.
96         </para>
97     </note>
99     <para>
100         Típicamente, pasará toda la configuración al constructor
101         <classname>Zend_Application</classname>
102         , pero también puede configurar
103         totalmente el objeto utilizando sus propios métodos. En esta
104         referencia
105         se ilustran ambos casos de uso.
106     </para>
108     <table id="zend.application.core-functionality.application.api.table">
109         <title>Métodos de Zend_Application</title>
110         <tgroup cols="4">
111             <thead>
112                 <row>
113                     <entry>Método</entry>
114                     <entry>Valor de Retorno</entry>
115                     <entry>Parámetros</entry>
116                     <entry>Descripción</entry>
117                 </row>
118             </thead>
119             <tbody>
120                 <row>
121                     <entry>
122                         <methodname>__construct($environment, $options = null)</methodname>
123                     </entry>
124                     <entry>
125                         <type>Void</type>
126                     </entry>
127                     <entry>
128                         <itemizedlist>
129                             <listitem>
130                                 <para>
131                                     <varname>$environment</varname>
132                                     :
133                                     <emphasis>requerido</emphasis>
134                                     ,.
135                                     String que representa el actual entorno de aplicación.
136                                     Strings típicos podrían incluir "desarrollo",
137                                     "pruebas", "qa", o "producción", pero será definido
138                                     por sus requisitos organizacionales.
139                                 </para>
140                             </listitem>
142                             <listitem>
143                                 <para>
144                                     <varname>$options</varname>
145                                     :
146                                     <emphasis>opcional</emphasis>
147                                     .
148                                     El argumento puede ser uno de los siguientes valores:
149                                 </para>
150                                 <itemizedlist>
151                                     <listitem>
152                                         <para>
153                                             <emphasis><type>String</type></emphasis>
154                                             : path
155                                             al archivo
156                                             <classname>Zend_Config</classname>
157                                             para cargarlo como donfiguración de su
158                                             aplicación.
159                                             <varname>$environment</varname>
160                                             se utilizará para
161                                             determinar qué sección de la configuración
162                                             se traerá.
163                                         </para>
164                                         <para>
165                                             As of 1.10, you may also pass multiple paths containing
166                                             config files to be merged into a single configuration.
167                                             This assists in reducing config duplication across many
168                                             contexts which share common settings (e.g. configs for
169                                             <acronym>HTTP</acronym>, or <acronym>CLI</acronym>, each
170                                             sharing some characteristics but with their own
171                                             conflicting values for others) or merely splitting a
172                                             long configuration across many smaller categorised
173                                             files. The parameter in this case is an array with a
174                                             single key "configs" whose value is an array of the
175                                             files to merge. Note: this means you either pass a
176                                             literal path, or
177                                             <command>array("configs"=>array("/path1","/path2"[,...]));</command>.
178                                         </para>
179                                     </listitem>
181                                     <listitem>
182                                         <para>
183                                             <emphasis>
184                                                 <type>Array</type>
185                                             </emphasis>
186                                             : array asociativo
187                                             de datos de configuración para su aplicación.
188                                         </para>
189                                     </listitem>
191                                     <listitem>
192                                         <para>
193                                             <emphasis>
194                                                 <classname>Zend_Config</classname>
195                                             </emphasis>
196                                             :
197                                             instancia del objeto de configuración.
198                                         </para>
199                                     </listitem>
200                                 </itemizedlist>
201                             </listitem>
202                         </itemizedlist>
203                     </entry>
204                     <entry>
205                         <para>
206                             Constructor. Los argumentos son como se describe,
207                             y será utilizado para establecer el estado incial del
208                             objeto. Una instancia de
209                             <classname>Zend_Loader_Autoloader</classname>
210                             es registrada durante la instanciación.
211                             Las opciones pasadas al onstructor se pasan a
212                             <methodname>setOptions()</methodname>
213                             .
214                         </para>
215                     </entry>
216                 </row>
218                 <row>
219                     <entry>
220                         <methodname>getEnvironment()</methodname>
221                     </entry>
222                     <entry>
223                         <type>String</type>
224                     </entry>
225                     <entry>N/A</entry>
226                     <entry>
227                         <para>
228                             Recuperar el string del medio ambiente que se pasó al
229                             constructor.
230                         </para>
231                     </entry>
232                 </row>
234                 <row>
235                     <entry>
236                         <methodname>getAutoloader()</methodname>
237                     </entry>
238                     <entry>
239                         <classname>Zend_Loader_Autoloader</classname>
240                     </entry>
241                     <entry>N/A</entry>
242                     <entry>
243                         <para>
244                             Recuperar la instancia de
245                             <classname>Zend_Loader_Autoloader</classname>
246                             registrados durante la instanciación.
247                         </para>
248                     </entry>
249                 </row>
251                 <row>
252                     <entry>
253                         <methodname>setOptions(array $options)</methodname>
254                     </entry>
255                     <entry>
256                         <classname>Zend_Application</classname>
257                     </entry>
258                     <entry>
259                         <itemizedlist>
260                             <listitem>
261                                 <para>
262                                     <varname>$options</varname>
263                                     :
264                                     <emphasis>requerido</emphasis>
265                                     .
266                                     Un array de opciones de aplicación.
267                                 </para>
268                             </listitem>
269                         </itemizedlist>
270                     </entry>
271                     <entry>
272                         <para>
273                             Todas las opciones se almacenan internamente, y llamando
274                             al método varias veces las opciones se fusionarán.
275                             Las opciones concordantes con los diversos métodos
276                             setter se pasarán a esos métodos.
277                             Como ejemplo, la opción "phpSettings" será pasada a
278                             <methodname>setPhpSettings()</methodname>
279                             .
280                             (Los nombres de opciones son indiferentes a mayúsculas/
281                             minúsculas.)
282                         </para>
283                     </entry>
284                 </row>
286                 <row>
287                     <entry>
288                         <methodname>getOptions()</methodname>
289                     </entry>
290                     <entry>
291                         <entry>array</entry>
292                     </entry>
293                     <entry>N/A</entry>
294                     <entry>
295                         <para>
296                             Recuperar todas las opciones usadas para inicializar el
297                             objeto; podría ser utilizada para guardar en cache a
298                             través de
299                             <classname>Zend_Config</classname>
300                             las
301                             opciones para serializar un formato entre reqerimientos.
302                         </para>
303                     </entry>
304                 </row>
306                 <row>
307                     <entry>
308                         <methodname>hasOption($key)</methodname>
309                     </entry>
310                     <entry>
311                         <type>Boolean</type>
312                     </entry>
313                     <entry>
314                         <itemizedlist>
315                             <listitem>
316                                 <para>
317                                     <varname>$key</varname>
318                                     : String opcional de la clave de lookup
319                                 </para>
320                             </listitem>
321                         </itemizedlist>
322                     </entry>
323                     <entry>
324                         <para>
325                             Determinar si una opción con la clave ha sido registrada
326                             o no. Las claves son indiferentes a mayúsculas/
327                             minúsculas.
328                         </para>
329                     </entry>
330                 </row>
332                 <row>
333                     <entry>
334                         <methodname>getOption($key)</methodname>
335                     </entry>
336                     <entry>
337                         <type>mixed</type>
338                     </entry>
339                     <entry>
340                         <itemizedlist>
341                             <listitem>
342                                 <para>
343                                     <varname>$key</varname>
344                                     : String opcional de la clave de lookup
345                                 </para>
346                             </listitem>
347                         </itemizedlist>
348                     </entry>
349                     <entry>
350                         <para>
351                             Recuperar el valor de la opción de una clave dada.
352                             Retorna
353                             <constant>NULL</constant>
354                             si la clave no existe.
355                         </para>
356                     </entry>
357                 </row>
359                 <row>
360                     <entry>
361                         <methodname>setPhpSettings(array $settings, $prefix = '')</methodname>
362                     </entry>
363                     <entry>
364                         <classname>Zend_Application</classname>
365                     </entry>
366                     <entry>
367                         <itemizedlist>
368                             <listitem>
369                                 <para>
370                                     <varname>$settings</varname>
371                                     :
372                                     <emphasis>requerido</emphasis>
373                                     .
374                                     Array asociativo en los settings de
375                                     <acronym>PHP</acronym>
376                                     <acronym>INI</acronym>
377                                     .
378                                 </para>
379                             </listitem>
381                             <listitem>
382                                 <para>
383                                     <varname>$prefix</varname>
384                                     :
385                                     <emphasis>opcional</emphasis>
386                                     .
387                                     Prefijo de tipo string para anteponer a la opción
388                                     claves. Usado internamente para permitir el mapping
389                                     anidado de matrices separados por puntos en las
390                                     claves de
391                                     <filename>php.ini</filename>
392                                     .
393                                     En el uso normal, este argumento nunca debe ser
394                                     pasado por un usuario.
395                                 </para>
396                             </listitem>
397                         </itemizedlist>
398                     </entry>
399                     <entry>
400                         <para>
401                             Establece un conjunto de ajustaes en
402                             <filename>php.ini</filename>
403                             . para run-time.
404                             Las configuraciones separadas por punto pueden ser
405                             anidadas jerárquicamente
406                             (lo que puede ocurrir con los archivos
407                             <acronym>INI</acronym>
408                             <classname>Zend_Config</classname>
409                             ) mediante un array de
410                             de arrays, y aún resolver correctamente.
411                         </para>
412                     </entry>
413                 </row>
415                 <row>
416                     <entry>
417                         <methodname>setAutoloaderNamespaces(array $namespaces)</methodname>
418                     </entry>
419                     <entry>
420                         <classname>Zend_Application</classname>
421                     </entry>
422                     <entry>
423                         <itemizedlist>
424                             <listitem>
425                                 <para>
426                                     <varname>$namespaces</varname>
427                                     :
428                                     <emphasis>requerido</emphasis>
429                                     .
430                                     Array de strings representando los namespaces a
431                                     registrar con la instancia
432                                     <classname>Zend_Loader_Autoloader</classname>
433                                     .
434                                 </para>
435                             </listitem>
436                         </itemizedlist>
437                     </entry>
438                     <entry>
439                         <para>
440                             Registra los namespaces con la instancia
441                             <classname>Zend_Loader_Autoloader</classname>
442                             .
443                         </para>
444                     </entry>
445                 </row>
447                 <row>
448                     <entry>
449                         <methodname>setBootstrap($path, $class = null)</methodname>
450                     </entry>
451                     <entry>
452                         <classname>Zend_Application</classname>
453                     </entry>
454                     <entry>
455                         <itemizedlist>
456                             <listitem>
457                                 <para>
458                                     <varname>$path</varname>
459                                     ::
460                                     <emphasis>requerido</emphasis>
461                                     .
462                                     Puede ser tanto una instancia de
463                                     <classname>Zend_Application_Bootstrap_Bootstrapper
464                                     </classname>,
465                                     un string del path a la clase bootstrap,
466                                     un arrray asociativo de classname =&gt;nombre_de_archivo,
467                                     o un array asociativo con las claves 'class' y 'path'.
468                                 </para>
469                             </listitem>
471                             <listitem>
472                                 <para>
473                                     <varname>$class</varname>
474                                     :
475                                     <emphasis>opcional</emphasis>
476                                     .
477                                     Si
478                                     <varname>$path</varname>
479                                     : es un string, entonces
480                                     <varname>$class</varname>
481                                     puede ser especificado,
482                                     y debe ser el string nombre de clase de la
483                                     clase contenida en el archivo representado por path.
484                                 </para>
485                             </listitem>
486                         </itemizedlist>
487                     </entry>
488                 </row>
490                 <row>
491                     <entry>
492                         <methodname>getBootstrap()</methodname>
493                     </entry>
494                     <entry>
495                         <constant>NULL</constant> |
496                         <classname>Zend_Application_Bootstrap_Bootstrapper</classname>
498                     </entry>
499                     <entry>N/A</entry>
500                     <entry>
501                         <para>
502                             Recuperar la instancia del bootstrap registrado.
503                         </para>
504                     </entry>
505                 </row>
507                 <row>
508                     <entry>
509                         <methodname>bootstrap()</methodname>
510                     </entry>
511                     <entry>
512                         <type>void</type>
513                     </entry>
514                     <entry>N/A</entry>
515                     <entry>
516                         <para>
517                             Llamar al método
518                             <methodname>bootstrap()</methodname>
519                             para cargar la aplicación.
520                         </para>
521                     </entry>
522                 </row>
524                 <row>
525                     <entry>
526                         <methodname>run()</methodname>
527                     </entry>
528                     <entry>
529                         <type>void</type>
530                     </entry>
531                     <entry>N/A</entry>
532                     <entry>
533                         <para>
534                             Llamar al método
535                             <methodname>run()</methodname>
536                             del bootstrap
537                             para despachar la aplicación.
538                         </para>
539                     </entry>
540                 </row>
541             </tbody>
542         </tgroup>
543     </table>
544 </sect2>