Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38c59ce

Browse files
committed
Added documentation section for Memcached
1 parent 3caf1fd commit 38c59ce

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

docs/en/reference/caching.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Memcache
6565

6666
In order to use the Memcache cache driver you must have it compiled
6767
and enabled in your php.ini. You can read about Memcache
68-
` on the PHP website <http://us2.php.net/memcache>`_. It will
68+
` on the PHP website <http://php.net/memcache>`_. It will
6969
give you a little background information about what it is and how
7070
you can use it as well as how to install it.
7171

@@ -82,6 +82,31 @@ driver by itself.
8282
$cacheDriver->setMemcache($memcache);
8383
$cacheDriver->save('cache_id', 'my_data');
8484
85+
Memcached
86+
~~~~~~~~
87+
88+
Memcached is a more recent and complete alternative extension to
89+
Memcache.
90+
91+
In order to use the Memcached cache driver you must have it compiled
92+
and enabled in your php.ini. You can read about Memcached
93+
` on the PHP website <http://php.net/memcached>`_. It will
94+
give you a little background information about what it is and how
95+
you can use it as well as how to install it.
96+
97+
Below is a simple example of how you could use the Memcached cache
98+
driver by itself.
99+
100+
.. code-block:: php
101+
102+
<?php
103+
$memcached = new Memcached();
104+
$memcached->addServer('memcache_host', 11211);
105+
106+
$cacheDriver = new \Doctrine\Common\Cache\MemcachedCache();
107+
$cacheDriver->setMemcached($memcached);
108+
$cacheDriver->save('cache_id', 'my_data');
109+
85110
Xcache
86111
~~~~~~
87112

0 commit comments

Comments
 (0)