<commit_before>Introduction
============

Doctrine Cache is a library that provides an interface for caching data.
It comes with implementations for some of the most popular caching data
stores. Here is what the ``Cache`` interface looks like.

.. code-block:: php
    namespace Doctrine\Common\Cache;

    interface Cache
    {
        public function fetch($id);
        public function contains($id);
        public function save($id, $data, $lifeTime = 0);
        public function delete($id);
        public function getStats();
    }

Here is an example that uses Memcache.

.. code-block:: php
    use Doctrine\Common\Cache\MemcacheCache;

    $memcache = new Memcache();
    $cache = new MemcacheCache();
    $cache->setMemcache($memcache);

    $cache->set('key', 'value');

    echo $cache->get('key') // prints "value"

Drivers
=======

Doctrine ships with several common drivers that you can easily use.
Below you can find information about all the available drivers.

ApcCache
--------

The ``ApcCache`` driver uses the ``apc_fetch``, ``apc_exists``, etc. functions that come
with PHP so no additional setup is required in order to use it.

.. code-block:: php
    $cache = new ApcCache();

ApcuCache
---------

The ``ApcCache`` driver uses the ``apcu_fetch``, ``apcu_exists``, etc. functions that come
with PHP so no additional setup is required in order to use it.

.. code-block:: php
    $cache = new ApcuCache();

ArrayCache
----------

The ``ArrayCache`` driver stores the cache data in PHPs memory and is not persisted anywhere.
This can be useful for caching things in memory for a single process when you don't need
the cache to be persistent across processes.

.. code-block:: php
    $cache = new ArrayCache();

ChainCache
----------

The ``ChainCache`` driver lets you chain multiple other drivers together easily.

.. code-block:: php
    $arrayCache = new ArrayCache();
    $apcuCache = new ApcuCache();
<commit_msg>ApcuCache driver name fixed<commit_after>Introduction
============

Doctrine Cache is a library that provides an interface for caching data.
It comes with implementations for some of the most popular caching data
stores. Here is what the ``Cache`` interface looks like.

.. code-block:: php
    namespace Doctrine\Common\Cache;

    interface Cache
    {
        public function fetch($id);
        public function contains($id);
        public function save($id, $data, $lifeTime = 0);
        public function delete($id);
        public function getStats();
    }

Here is an example that uses Memcache.

.. code-block:: php
    use Doctrine\Common\Cache\MemcacheCache;

    $memcache = new Memcache();
    $cache = new MemcacheCache();
    $cache->setMemcache($memcache);

    $cache->set('key', 'value');

    echo $cache->get('key') // prints "value"

Drivers
=======

Doctrine ships with several common drivers that you can easily use.
Below you can find information about all the available drivers.

ApcCache
--------

The ``ApcCache`` driver uses the ``apc_fetch``, ``apc_exists``, etc. functions that come
with PHP so no additional setup is required in order to use it.

.. code-block:: php
    $cache = new ApcCache();

ApcuCache
---------

The ``ApcuCache`` driver uses the ``apcu_fetch``, ``apcu_exists``, etc. functions that come
with PHP so no additional setup is required in order to use it.

.. code-block:: php
    $cache = new ApcuCache();

ArrayCache
----------

The ``ArrayCache`` driver stores the cache data in PHPs memory and is not persisted anywhere.
This can be useful for caching things in memory for a single process when you don't need
the cache to be persistent across processes.

.. code-block:: php
    $cache = new ArrayCache();

ChainCache
----------

The ``ChainCache`` driver lets you chain multiple other drivers together easily.

.. code-block:: php
    $arrayCache = new ArrayCache();
    $apcuCache = new ApcuCache();

{'fraction_non_alphanumeric': 0.12304537298128684, 'fraction_numerical': 0.0005126890540886952, 'mean_word_length': 3.297356828193833, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4579420', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1055, 'n_words': 461}