From 5d8dc1757fc70696e1ce8d3aa72b8223f51c2d8f Mon Sep 17 00:00:00 2001 From: reypm Date: Sun, 30 Jul 2017 12:51:39 -0400 Subject: [PATCH 1/3] Updating docs to support for APCu as a cache driver --- docs/en/reference/advanced-configuration.rst | 2 ++ docs/en/reference/caching.rst | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/docs/en/reference/advanced-configuration.rst b/docs/en/reference/advanced-configuration.rst index abb72636c..00f8f8969 100644 --- a/docs/en/reference/advanced-configuration.rst +++ b/docs/en/reference/advanced-configuration.rst @@ -152,6 +152,7 @@ The recommended implementations for production are: - ``Doctrine\Common\Cache\ApcCache`` +- ``Doctrine\Common\Cache\ApcuCache`` - ``Doctrine\Common\Cache\MemcacheCache`` - ``Doctrine\Common\Cache\XcacheCache`` - ``Doctrine\Common\Cache\RedisCache`` @@ -183,6 +184,7 @@ The recommended implementations for production are: - ``Doctrine\Common\Cache\ApcCache`` +- ``Doctrine\Common\Cache\ApcuCache`` - ``Doctrine\Common\Cache\MemcacheCache`` - ``Doctrine\Common\Cache\XcacheCache`` - ``Doctrine\Common\Cache\RedisCache`` diff --git a/docs/en/reference/caching.rst b/docs/en/reference/caching.rst index 512254ef6..0839ff614 100644 --- a/docs/en/reference/caching.rst +++ b/docs/en/reference/caching.rst @@ -63,6 +63,24 @@ by itself. $cacheDriver = new \Doctrine\Common\Cache\ApcCache(); $cacheDriver->save('cache_id', 'my_data'); +APCu +~~~ + +In order to use the APCu cache driver you must have it compiled and +enabled in your php.ini. You can read about APCu +`in the PHP Documentation `_. It will give +you a little background information about what it is and how you +can use it as well as how to install it. + +Below is a simple example of how you could use the APCu cache driver +by itself. + +.. code-block:: php + + save('cache_id', 'my_data'); + Memcache ~~~~~~~~ From 0c30bab776793b750be82cbd0e688af5bcaed7f8 Mon Sep 17 00:00:00 2001 From: reypm Date: Sun, 30 Jul 2017 14:40:19 -0400 Subject: [PATCH 2/3] Adding extra tilde and updating APC references to APCu (APC is deprecated as per http://php.net/manual/en/intro.apc.php) --- docs/en/reference/caching.rst | 12 ++++++------ docs/en/reference/metadata-drivers.rst | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/reference/caching.rst b/docs/en/reference/caching.rst index 0839ff614..f2937c780 100644 --- a/docs/en/reference/caching.rst +++ b/docs/en/reference/caching.rst @@ -60,11 +60,11 @@ by itself. .. code-block:: php save('cache_id', 'my_data'); APCu -~~~ +~~~~ In order to use the APCu cache driver you must have it compiled and enabled in your php.ini. You can read about APCu @@ -305,7 +305,7 @@ use on your ORM configuration. setQueryCacheImpl(new \Doctrine\Common\Cache\ApcCache()); + $config->setQueryCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); Result Cache ~~~~~~~~~~~~ @@ -318,7 +318,7 @@ cache implementation. .. code-block:: php setResultCacheImpl(new \Doctrine\Common\Cache\ApcCache()); + $config->setResultCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); Now when you're executing DQL queries you can configure them to use the result cache. @@ -335,7 +335,7 @@ result cache driver. .. code-block:: php setResultCacheDriver(new \Doctrine\Common\Cache\ApcCache()); + $query->setResultCacheDriver(new \Doctrine\Common\Cache\ApcuCache()); .. note:: @@ -387,7 +387,7 @@ first. .. code-block:: php setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcCache()); + $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); Now the metadata information will only be parsed once and stored in the cache driver. diff --git a/docs/en/reference/metadata-drivers.rst b/docs/en/reference/metadata-drivers.rst index 6b9cb31e4..5162dee2d 100644 --- a/docs/en/reference/metadata-drivers.rst +++ b/docs/en/reference/metadata-drivers.rst @@ -35,7 +35,7 @@ an entity. .. code-block:: php getConfiguration()->setMetadataCacheImpl(new ApcCache()); + $em->getConfiguration()->setMetadataCacheImpl(new ApcuCache()); If you want to use one of the included core metadata drivers you From 40ee7af9c8e44541c0a1dc1df9065cfbcdf81e44 Mon Sep 17 00:00:00 2001 From: reypm Date: Sun, 30 Jul 2017 15:31:42 -0400 Subject: [PATCH 3/3] Fixing issue in APC driver --- docs/en/reference/caching.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/caching.rst b/docs/en/reference/caching.rst index f2937c780..4423fb130 100644 --- a/docs/en/reference/caching.rst +++ b/docs/en/reference/caching.rst @@ -60,7 +60,7 @@ by itself. .. code-block:: php save('cache_id', 'my_data'); APCu