<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.application.examples">
    <title>Examples</title>

    <para>
        The Bootstrap class itself will typically be fairly minimal; often,
        it will simply be an empty stub extending the base bootstrap class:
    </para>

    <programlisting role="php"><![CDATA[
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}
]]>
    </programlisting>

    <para>
        With a corresponding configuration file:
    </para>

    <programlisting role="ini"><![CDATA[
; APPLICATION_PATH/configs/application.ini
[production]
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

[development : testing]
[development : production]
]]></programlisting>

    <para>
        However, should custom initialization be necessary, you have two
        choices. First, you can write methods prefixed with <code>_init</code>
        to specify discrete code to bootstrap. These methods will be called by
        bootstrap(), and can also be called as if they were public methods:
        <code>bootstrap&lt;resource&gt;()</code>. They should accept an optional
        array of options.
    </para>

    <para>
        If your resource method returns a value, it will be stored in a
        container in the bootstrap. This can be useful when different resources
        need to interact (such as one resource injecting itself into another).
        The method <code>getResource()</code> can then be used to retrieve those
        values.
    </para>

    <para>
        The example below shows a resource method for intializing the request
        object. It makes use of dependency tracking (it depends on the front
        controller resource), fetching a resource from the bootstrap, and
        returning a value to store in the bootstrap.
    </para>

    <programlisting role="php"><![CDATA[
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{<commit_msg>DOCUMENTATION English:  - fixed typo<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.application.examples">
    <title>Examples</title>

    <para>
        The Bootstrap class itself will typically be fairly minimal; often,
        it will simply be an empty stub extending the base bootstrap class:
    </para>

    <programlisting role="php"><![CDATA[
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}
]]>
    </programlisting>

    <para>
        With a corresponding configuration file:
    </para>

    <programlisting role="ini"><![CDATA[
; APPLICATION_PATH/configs/application.ini
[production]
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

[development : testing]
[development : production]
]]></programlisting>

    <para>
        However, should custom initialization be necessary, you have two
        choices. First, you can write methods prefixed with <code>_init</code>
        to specify discrete code to bootstrap. These methods will be called by
        bootstrap(), and can also be called as if they were public methods:
        <code>bootstrap&lt;resource&gt;()</code>. They should accept an optional
        array of options.
    </para>

    <para>
        If your resource method returns a value, it will be stored in a
        container in the bootstrap. This can be useful when different resources
        need to interact (such as one resource injecting itself into another).
        The method <code>getResource()</code> can then be used to retrieve those
        values.
    </para>

    <para>
        The example below shows a resource method for initializing the request
        object. It makes use of dependency tracking (it depends on the front
        controller resource), fetching a resource from the bootstrap, and
        returning a value to store in the bootstrap.
    </para>

    <programlisting role="php"><![CDATA[
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
{'fraction_non_alphanumeric': 0.086977414704469, 'fraction_numerical': 0.0019221528111484864, 'mean_word_length': 3.3591623036649216, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 2, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1372908', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1026, 'n_words': 427}