Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cache] Use options from Memcached DSN#23978

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@Bukashk0zzz
Copy link
Contributor

QA
Branch?3.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#23962
LicenseMIT
Doc PR-

This PR allows to pass options in cache config.
Example:

framework:cache:app:cache.adapter.memcacheddefault_memcached_provider:'memcached://%env(MEMCACHE_HOST)%?socket_recv_size=1&socket_send_size=2'

Nek-, trntv, ft-1408, myh-denis, eugenekurasov, kHorozhanov, and Jean85 reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas added this to the3.4 milestoneAug 24, 2017
@Bukashk0zzzBukashk0zzzforce-pushed thecache-memcached-config-parameters branch 2 times, most recently frome85dcab to264d764CompareAugust 25, 2017 06:16
@Bukashk0zzz
Copy link
ContributorAuthor

There are needed any work on this PR from me?
I saw that tests failed in 3.4 with php 7.1 already.
Haven't any idea why 'Class 'Memcached' not found' in AppVeyor tests

}
}

publicfunctionprovideDSNWithOptions()

Choose a reason for hiding this comment

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

should beprovideDsnWithOptions
the provider should do a class_exists check on Memcached and yield nothing when not, in order to allow skipping the tests when Memcached is not installed

@Bukashk0zzzBukashk0zzzforce-pushed thecache-memcached-config-parameters branch from264d764 to1363664CompareAugust 25, 2017 08:14
@Bukashk0zzz
Copy link
ContributorAuthor

@nicolas-grekas fixed.

@nicolas-grekasnicolas-grekas self-requested a reviewAugust 25, 2017 16:33

* added PruneableInterface so PSR-6 or PSR-16 cache implementations can declare support for manual stale cache pruning
* added FilesystemTrait::prune() and PhpFilesTrait::prune() implementations
* added Using options from Memcached DSN
Copy link
Member

Choose a reason for hiding this comment

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

using without capital U

@Bukashk0zzzBukashk0zzzforce-pushed thecache-memcached-config-parameters branch from1363664 to7abc4b2CompareAugust 27, 2017 07:46
@Bukashk0zzz
Copy link
ContributorAuthor

Updated

if (isset($params['query'])) {
parse_str($params['query'],$query);
$params +=$query;
$options +=$query;

Choose a reason for hiding this comment

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

this means that the precedence is:

  1. options provided as 2nd argument
  2. win over options provided as part of the DSN
  3. who then win over defaults.

But in RedisTrait, 1. and 2. are swapped:

  1. options provided as part of the DSN
  2. win over options provided as 2nd arg
  3. who then win over defaults.

This allows "the infrastructure" to take over the app config.
I think it also makes sense to do the same here.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

see comment about precedence

@Bukashk0zzzBukashk0zzzforce-pushed thecache-memcached-config-parameters branch from7abc4b2 to94ad162CompareSeptember 5, 2017 06:14
@Bukashk0zzzBukashk0zzzforce-pushed thecache-memcached-config-parameters branch from94ad162 to5798dd6CompareSeptember 5, 2017 06:16
@Bukashk0zzz
Copy link
ContributorAuthor

@nicolas-grekas Fixed. Also updated tests for this case.

@fabpot
Copy link
Member

Thank you@Bukashk0zzz.

@fabpotfabpot merged commit5798dd6 intosymfony:3.4Sep 5, 2017
fabpot added a commit that referenced this pull requestSep 5, 2017
This PR was merged into the 3.4 branch.Discussion----------[Cache] Use options from Memcached DSN| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#23962| License       | MIT| Doc PR        | -This PR allows to pass options in cache config.Example:```yamlframework:    cache:        app: cache.adapter.memcached        default_memcached_provider: 'memcached://%env(MEMCACHE_HOST)%?socket_recv_size=1&socket_send_size=2'```Commits-------5798dd6 [Cache] Use options from Memcached DSN
This was referencedOct 18, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@Bukashk0zzz@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp