Zend_Application-AvailableResources-CacheManager.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect2 id="zend.application.available-resources.cachemanager">
  4. <title>Zend_Application_Resource_Cachemanager</title>
  5. <para>
  6. <classname>Zend_Application_Resource_Cachemanager</classname> may be
  7. utilised to configure a set of <classname>Zend_Cache</classname> option
  8. bundles for use when lazy loading caches using
  9. <classname>Zend_Cache_Manager</classname>
  10. </para>
  11. <para>
  12. As the Cache Manager is a lazy loading mechanism, the options are translated
  13. to option templates used to instantiate a cache object on request.
  14. </para>
  15. <example id="zend.application.available-resources.cachemanager.configExample">
  16. <title>Sample Cachemanager resource configuration</title>
  17. <para>
  18. Below is a sample <acronym>INI</acronym> file showing how
  19. <classname>Zend_Cache_Manager</classname> may be configured. The format
  20. is the Cachemanager resource prefix (<property>resources.cachemanager</property>)
  21. followed be the name to assign to an option cache template or bundle (e.g.
  22. <property>resources.cachemanager.database</property>) and finally followed by a
  23. typical <classname>Zend_Cache</classname> option.
  24. </para>
  25. <programlisting language="ini"><![CDATA[
  26. resources.cachemanager.database.frontend.name = Core
  27. resources.cachemanager.database.frontend.options.lifetime = 7200
  28. resources.cachemanager.database.frontend.options.automatic_serialization = true
  29. resources.cachemanager.database.backend.name = File
  30. resources.cachemanager.database.backend.options.cache_dir = "/path/to/cache"
  31. ]]></programlisting>
  32. <para>
  33. Actually retrieving this cache from the Cache Manager is as simple as
  34. accessing an instance of the Manager and calling
  35. <command>$cacheManager->getCache('database');</command>.
  36. </para>
  37. </example>
  38. </sect2>