[ZF-10089] Zend_Log
[zend.git] / documentation / manual / en / module_specs / Zend_Application-CoreFunctionality-Bootstrap_Bootstrap.xml
blob46b4726fba5a1f50aceb5e7f86b28a4d84c051c3
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Reviewed: no -->
3 <sect2 id="zend.application.core-functionality.bootstrap-bootstrap">
4     <title>Zend_Application_Bootstrap_Bootstrap</title>
6     <para>
7         <classname>Zend_Application_Bootstrap_Bootstrap</classname> is a concrete
8         implementation of <link
9             linkend="zend.application.core-functionality.bootstrap-bootstrapabstract">Zend_Application_Bootstrap_BootstrapAbstract</link>.
10         It's primary feature are that it registers the <link
11             linkend="zend.application.available-resources.frontcontroller">Front
12             Controller resource</link>, and that the <methodname>run()</methodname> method
13         first checks that a default module is defined and then dispatches the
14         front controller.
15     </para>
17     <para>
18         In most cases, you will want to extend this class for your bootstrapping
19         needs, or simply use this class and provide a list of resource plugins
20         to utilize.
21     </para>
23     <sect3 id="zend.application.core-functionality.bootstrap-bootstrap.autoloading">
24         <title>Enabling Application Autoloading</title>
26         <para>
27             Additionally, this bootstrap implementation provides the ability to specify the
28             "namespace" or class prefix for resources located in its tree, which will enable
29             autoloading of various application resources; essentially, it instantiates a <link
30                 linkend="zend.loader.autoloader-resource.module">Zend_Application_Module_Autoloader</link>
31             object, providing the requested namespace and the bootstrap's directory as arguments.
32             You may enable this functionality by providing a namespace to the "appnamespace"
33             configuration option. As an <acronym>INI</acronym> example:
34         </para>
36         <programlisting language="ini"><![CDATA[
37 appnamespace = "Application"
38 ]]></programlisting>
40         <para>
41             Or in <acronym>XML</acronym>:
42         </para>
44         <programlisting language="xml"><![CDATA[
45 <appnamespace>Application</appnamespace>
46 ]]></programlisting>
48         <para>
49             By default, <classname>Zend_Tool</classname> will enable this option with the value
50             "Application".
51         </para>
53         <para>
54             Alternately, you can simply define the <varname>$_appNamespace</varname> property of
55             your bootstrap class with the appropriate value:
56         </para>
58         <programlisting language="php"><![CDATA[
59 class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
61     protected $_appNamespace = 'Application';
63 ]]></programlisting>
64     </sect3>
65 </sect2>