Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

Commit

Permalink
some minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Sep 27, 2012
1 parent ef7934b commit de3381a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions en/reference/caching.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ used in your own libraries to caching.
Introduction Introduction
------------ ------------


Doctrine caching provides a very simple interface on top of which Doctrine Cache provides a very simple interface for which several out
several out of the box implementations are provided: of the box implementations are provided:


- ApcCache (requires ext/apc) - ApcCache (requires ext/apc)
- ArrayCache (in memory, lifetime of the request) - ArrayCache (in memory, lifetime of the request)
Expand All @@ -23,6 +23,9 @@ several out of the box implementations are provided:
- XcacheCache.php (requires ext/xcache) - XcacheCache.php (requires ext/xcache)
- ZendDataCache.php (requires Zend Server Platform) - 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 .. code-block :: php
<?php <?php
Expand All @@ -33,3 +36,13 @@ several out of the box implementations are provided:
$id = do_something(); $id = do_something();
$cache->save("some key", $id); $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.