Permalink
Browse files

some minor tweaks

  • Loading branch information...
1 parent ef7934b commit de3381a602954ba7dabcf7007b17b946ac60a2be @lsmith77 lsmith77 committed Sep 27, 2012
Showing with 15 additions and 2 deletions.
  1. +15 −2 en/reference/caching.rst
@@ -9,8 +9,8 @@ used in your own libraries to caching.
Introduction
------------
-Doctrine caching provides a very simple interface on top of which
-several out of the box implementations are provided:
+Doctrine Cache provides a very simple interface for which several out
+of the box implementations are provided:
- ApcCache (requires ext/apc)
- ArrayCache (in memory, lifetime of the request)
@@ -23,6 +23,9 @@ several out of the box implementations are provided:
- XcacheCache.php (requires ext/xcache)
- ZendDataCache.php (requires Zend Server Platform)
+A simple code example using ``ArrayCache`` to cache data in memory for the lifetime
+of the request can be found below.
+
.. code-block :: php
<?php
@@ -33,3 +36,13 @@ several out of the box implementations are provided:
$id = do_something();
$cache->save("some key", $id);
}
+
+ ..
+
+ $cache->contains("some key");
+ $cache->delete("some key");
+
+ // note all cache backends provide stats
+ foreach ($cache->getStats() as $key => $value) {
+ echo "$key: $value";
+ }

0 comments on commit de3381a

Please sign in to comment.