-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Adding documentation about the simple cache PSR-16 implementation #7417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Key Concepts | ||
------------ | ||
Cache (PSR-6) Versus Simple Cache (PSR-16) | ||
------------------------------------------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolas-grekas Is this small section accurate? Everything else is straightforward - I just wanted you to check this one spot! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
components/cache.rst
Outdated
|
||
.. tip:: | ||
|
||
To find out more about each of these classes, you can read th |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can read theee
components/cache/cache_pools.rst
Outdated
|
||
$fileCache = new FilesystemAdapter(); | ||
|
||
$cache = new TraceableAdapter(array($fileCache)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No array wrapper
components/cache.rst
Outdated
|
||
.. toctree:: | ||
:glob: | ||
:maxdepth: 1 | ||
|
||
cache/* | ||
|
||
.. _cache-component-psr16-caching: | ||
|
||
Simple Caching (PSR-16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move the simple cache part (PSF-16) before the complex cache part (PSR-6). That's the usual practice in docs: simple first and then build up to complex.
components/cache.rst
Outdated
|
||
This part of the component is an implementation of `PSR-16`_, which means that its | ||
basic API is the same as defined in the standard. First, create a cache object from | ||
one of the built-in cache clases. For example, to create a filesystem-based cache, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clases
-> classes
components/cache/cache_pools.rst
Outdated
@@ -5,8 +5,8 @@ | |||
single: Redis Cache | |||
single: PDO Cache, Doctrine DBAL Cache | |||
|
|||
Cache Pools | |||
=========== | |||
Cache Pools & Supported Adapters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&
-> and
?
components/cache/cache_pools.rst
Outdated
'memcached://user:pass@localhost?weight=33', | ||
|
||
// options, including username, password and Memcached::OPT_* options | ||
['persistent_id' => '_products_cache'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long array syntax here.
components/cache/cache_pools.rst
Outdated
// options, including username, password and Memcached::OPT_* options | ||
['persistent_id' => '_products_cache'] | ||
); | ||
$memcachedClient = MemcachedAdapter::createConnection([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here too, long array syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this!
Feedback applied! And I added the last section about converting between the 2 caches Status: Needs Review |
components/cache.rst
Outdated
// $numProducts = $cache->get('stats.num_products', 100); | ||
|
||
// remove the cache key | ||
$cache->deleteItem('stats.num_products'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteItem()
should be delete()
?
components/cache/cache_pools.rst
Outdated
// options, including username, password and Memcached::OPT_* options | ||
array('persistent_id' => '_products_cache') | ||
); | ||
$memcachedClient = MemcachedAdapter::createConnection(array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this repeated $memcachedClient
variable defined on purpose? Should we merge its contents with the previous variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Status: reviewed
Hi guys!
This covers #7409!
Cheers!