Skip to content

Adding an array adapter #25892

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

Merged
merged 1 commit into from
Jan 31, 2018
Merged

Conversation

weaverryan
Copy link
Member

@weaverryan weaverryan commented Jan 22, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR symfony/symfony-docs#9110

There's no simple way to disable caching (e.g. in the dev) environment. Setting up an array adapter is a very simple way to allow this :).

@xabbuh xabbuh added this to the 4.1 milestone Jan 23, 2018
@xabbuh xabbuh added the Cache label Jan 23, 2018
<tag name="cache.pool" clearer="cache.default_clearer" />
<tag name="monolog.logger" channel="cache" />
<argument>0</argument> <!-- default lifetime -->
<call method="setLogger">
Copy link
Member

@xabbuh xabbuh Jan 23, 2018

Choose a reason for hiding this comment

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

There is no setLogger() method in ArrayAdapter, is there?

never mind, it is, ArrayAdapter uses ArrayTrait which in turn uses LoggerAwareTrait

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jan 24, 2018

did you test it?
AFAIK, adding the cache.pool tag requires a special order and list of arguments on the constructor, which is not the case here (esp $namespace first), isn't it?

@weaverryan
Copy link
Member Author

Yes, tested in a real project! And you're right about the ArrayAdapter argument thing, but it was already taken into account:

} elseif ('namespace' !== $attr || ArrayAdapter::class !== $adapter->getClass()) {

@mickaelandrieu
Copy link
Contributor

There's no simple way to disable caching (e.g. in the dev) environment.

Why not using NullAdapter instead? using ArrayAdapter will cache the values, even if it's only for a request, isn't it?

@nicolas-grekas
Copy link
Member

Thank you @weaverryan.

@nicolas-grekas nicolas-grekas merged commit f92e03d into symfony:master Jan 31, 2018
nicolas-grekas added a commit that referenced this pull request Jan 31, 2018
This PR was merged into the 4.1-dev branch.

Discussion
----------

Adding an array adapter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | symfony/symfony-docs#9110

There's no simple way to *disable* caching (e.g. in the dev) environment. Setting up an array adapter is a very simple way to allow this :).

Commits
-------

f92e03d adding an array adapter
@weaverryan weaverryan deleted the add_array_adapter branch February 1, 2018 01:48
@fabpot fabpot mentioned this pull request May 7, 2018
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.

8 participants