8000 Adding documentation about the simple cache PSR-16 implementation by weaverryan · Pull Request #7417 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 8 commits into from
Closed

Adding documentation about the simple cache PSR-16 implementation #7417

wants to merge 8 commits into from

Conversation

weaverryan
Copy link
Member
@weaverryan weaverryan commented Jan 26, 2017

Hi guys!

This covers #7409!

Cheers!

Key Concepts
------------
Cache (PSR-6) Versus Simple Cache (PSR-16)
------------------------------------------
Copy link
Member Author

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!

Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!


.. tip::

To find out more about each of these classes, you can read th
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can read theee


$fileCache = new FilesystemAdapter();

$cache = new TraceableAdapter(array($fileCache));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No array wrapper

8000

.. toctree::
:glob:
:maxdepth: 1

cache/*

.. _cache-component-psr16-caching:

Simple Caching (PSR-16)
Copy link
Member

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.


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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clases -> classes

@@ -5,8 +5,8 @@
single: Redis Cache
single: PDO Cache, Doctrine DBAL Cache

Cache Pools
===========
Cache Pools & Supported Adapters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

& -> and ?

'memcached://user:pass@localhost?weight=33',

// options, including username, password and Memcached::OPT_* options
['persistent_id' => '_products_cache']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long array syntax here.

// options, including username, password and Memcached::OPT_* options
['persistent_id' => '_products_cache']
);
$memcachedClient = MemcachedAdapter::createConnection([
Copy link
Member

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

Copy link
Member
@javiereguiluz javiereguiluz left a 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!

@weaverryan
Copy link
Member Author

Feedback applied! And I added the last section about converting between the 2 caches

Status: Needs Review

@weaverryan weaverryan changed the title [WIP] Adding documentation about the simple cache PSR-16 implementation Adding documentation about the simple cache PSR-16 implementation Jan 27, 2017
// $numProducts = $cache->get('stats.num_products', 100);

// remove the cache key
$cache->deleteItem('stats.num_products');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleteItem() should be delete() ?

@javiereguiluz javiereguiluz added this to the 3.3 milestone Feb 1, 2017
// options, including username, password and Memcached::OPT_* options
array('persistent_id' => '_products_cache')
);
$memcachedClient = MemcachedAdapter::createConnection(array(
Copy link
Member

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?

Copy link
Member
@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Status: reviewed

@weaverryan weaverryan closed this in 7893772 Feb 6, 2017
@weaverryan weaverryan deleted the simple-cache branch February 6, 2017 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0