<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect2 id="zend.application.available-resources.cachemanager">
    <title>Zend_Application_Resource_Cachemanager</title>

    <para>
        <classname>Zend_Application_Resource_Cachemanager</classname> may be
        utilised to configure a set of <classname>Zend_Cache</classname> option
        bundles for use when lazy loading caches using
        <classname>Zend_Cache_Manager</classname>
    </para>

    <para>
        As the Cache Manager is a lazy loading mechanism, the options are translated
        to option templates used to instantiate a cache object on request.
    </para>

    <example id="zend.application.available-resources.cachemanager.configExample">
        <title>Sample Cachemanager resource configuration</title>

        <para>
            Below is a sample <acronym>INI</acronym> file showing how
            <classname>Zend_Cache_Manager</classname> may be configured. The format
            is the Cachemanager resource prefix (<property>resources.cachemanager</property>)
            followed be the name to assign to an option cache template or bundle (e.g.
            <property>resources.cachemanager.database</property>) and finally followed by a
            typical <classname>Zend_Cache</classname> option.
        </para>

        <programlisting language="ini"><![CDATA[
resources.cachemanager.database.frontend.name = Core
resources.cachemanager.database.frontend.customFrontendNaming = false
resources.cachemanager.database.frontend.options.lifetime = 7200
resources.cachemanager.database.frontend.options.automatic_serialization = true
resources.cachemanager.database.backend.name = File
resources.cachemanager.database.backend.customBackendNaming = false
resources.cachemanager.database.backend.options.cache_dir = "/path/to/cache"
resources.cachemanager.database.frontendBackendAutoload = false
]]></programlisting>

        <para>
            Actually retrieving this cache from the Cache Manager is as simple as
            accessing an instance of the Manager and calling
            <command>$cacheManager->getCache('database');</command>.
        </para>

        <para>
            See <methodname>Zend_Cache::factory()</methodname> method to get default values
            description.
        </para>
    </example>
</sect2><commit_msg>Clarified how to retrieve the bootstrapped Zend_Cache_Manager instance from a bootstrap<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect2 id="zend.application.available-resources.cachemanager">
    <title>Zend_Application_Resource_Cachemanager</title>

    <para>
        <classname>Zend_Application_Resource_Cachemanager</classname> may be
        utilised to configure a set of <classname>Zend_Cache</classname> option
        bundles for use when lazy loading caches using
        <classname>Zend_Cache_Manager</classname>
    </para>

    <para>
        As the Cache Manager is a lazy loading mechanism, the options are translated
        to option templates used to instantiate a cache object on request.
    </para>

    <example id="zend.application.available-resources.cachemanager.configExample">
        <title>Sample Cachemanager resource configuration</title>

        <para>
            Below is a sample <acronym>INI</acronym> file showing how
            <classname>Zend_Cache_Manager</classname> may be configured. The format
            is the Cachemanager resource prefix (<property>resources.cachemanager</property>)
            followed be the name to assign to an option cache template or bundle (e.g.
            <property>resources.cachemanager.database</property>) and finally followed by a
            typical <classname>Zend_Cache</classname> option.
        </para>

        <programlisting language="ini"><![CDATA[
resources.cachemanager.database.frontend.name = Core
resources.cachemanager.database.frontend.customFrontendNaming = false
resources.cachemanager.database.frontend.options.lifetime = 7200
resources.cachemanager.database.frontend.options.automatic_serialization = true
resources.cachemanager.database.backend.name = File
resources.cachemanager.database.backend.customBackendNaming = false
resources.cachemanager.database.backend.options.cache_dir = "/path/to/cache"
resources.cachemanager.database.frontendBackendAutoload = false
]]></programlisting>

        <para>
            Actually retrieving this cache from the Cache Manager is as simple as
            accessing an instance of the Manager (<classname>Zend_Cache_Manager</classname>)
            retrieved from <classname>Zend_Application_Resource_Cachemanager</classname> and
            calling <methodname>Zend_Cache_Manager::getCache('database')</methodname>. The example
            below is taken from a controller where the bootstrap class can be accessed as
            a Front Controller parameter (which is automatically assigned during bootstrapping).
            As you can see, the Cache Manager Resource implements a <methodname>
            getCacheManager()</methodname> method to retrieve the bootstrapped instance
            of <classname>Zend_Cache_Manager</classname>.
        </para>

        <programlisting language="php"><![CDATA[
$manager = $this->getFrontController()
            ->getParam('bootstrap')
            ->getResource('cachemanager')
            ->getCacheManager();
$dbCache = $manager->getCache('database');
]]></programlisting>

        <para>
            See <methodname>Zend_Cache::factory()</methodname> method to get a
            description of the default values you can assign when configuring a
            cache via a configuration file such as out example INI file above.
        </para>
    </example>
</sect2>
{'fraction_non_alphanumeric': 0.09027777777777778, 'fraction_numerical': 0.003125, 'mean_word_length': 3.438366718027735, 'pattern_counts': {'":': 0, '<': 100, '<?xml version=': 2, '>': 106, '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': '2502136', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1442, 'n_words': 412}