-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Appends cache namespace when it exists (for L2C regions) #6223
Conversation
@Ocramius should we also port it for 2.5.x? |
52e24ed
to
a722785
Compare
$factory = new DefaultCacheFactory($this->regionsConfig, $cache); | ||
|
||
$fooRegion = $factory->getRegion( | ||
[ |
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.
Minor alignment issues here
|
||
$namespace = $cacheAdapter->getNamespace(); | ||
|
||
if (!empty($namespace)) { |
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.
Please use '' === $namespace
, unless getNamespace
only allows string as return value
] | ||
); | ||
$barRegion = $factory->getRegion( | ||
[ |
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.
Alignment issues here
); | ||
|
||
$this->assertSame('testing:foo', $fooRegion->getCache()->getNamespace()); | ||
$this->assertSame('testing:bar', $barRegion->getCache()->getNamespace()); |
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.
Are prefixes for non-namespaced caches checked in some existing tests??
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.
We're overriding the namespace without even checking if it was previously set, what causes problems when people uses that feature 😉
a722785
to
eaedc37
Compare
LGTM 👍 |
We're overriding the namespace without even checking if it was previously set, what causes problems when people uses that feature 😉