Bläddra i källkod

Clarified how to retrieve the bootstrapped Zend_Cache_Manager instance from a bootstrap

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22115 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 15 år sedan
förälder
incheckning
0ebdd2235b

+ 19 - 4
documentation/manual/en/module_specs/Zend_Application-AvailableResources-CacheManager.xml

@@ -40,13 +40,28 @@ resources.cachemanager.database.frontendBackendAutoload = false
 
 
         <para>
         <para>
             Actually retrieving this cache from the Cache Manager is as simple as
             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>.
+            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>
         </para>
 
 
+        <programlisting language="php"><![CDATA[
+$manager = $this->getFrontController()
+            ->getParam('bootstrap')
+            ->getResource('cachemanager')
+            ->getCacheManager();
+$dbCache = $manager->getCache('database');
+]]></programlisting>
+
         <para>
         <para>
-            See <methodname>Zend_Cache::factory()</methodname> method to get default values
-            description.
+            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>
         </para>
     </example>
     </example>
 </sect2>
 </sect2>