.. _extensions-extmemcache:
.. _ext-memcache:
ext/memcache
++++++++++++
Extension Memcache.
Memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications.
.. code-block:: php
connect('localhost', 11211) or die ('Could not connect');
$version = $memcache->getVersion();
echo 'Server\'s version: '.$version.'
';
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$memcache->set('key', $tmp_object, false, 10) or die ('Failed to save data at the server');
echo 'Store data in the cache (data will expire in 10 seconds)
';
$get_result = $memcache->get('key');
echo 'Data from the cache:
';
var_dump($get_result);
?>
See also `Memcache on PHP `_ and `memcache on github `_.
Specs
_____
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Short name | Extensions/Extmemcache |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Rulesets | :ref:`All `, :ref:`Appinfo `, :ref:`CE `, :ref:`Changed Behavior ` |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Exakat since | 0.8.4 |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| PHP Version | All |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Severity | |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Time To Fix | |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Precision | Very high |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Available in | `Entreprise Edition `_, `Community Edition `_, `Exakat Cloud `_ |
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+