Comments (11)
According to documentation, those return values cannot be returned from a simple get. So please provide a test case to prove something else.
from cache.
@Tobion unfortunately the docs are not revealing every implementation detail. There are even tests that cover those constants.
from cache.
I don't see a test for get
and RES_NOTFOUND
.
from cache.
I can't provide a test, but I suppose that if you try a get
after shutting down memcached you won't get RES_NOTFOUND (can't try right now). At present I'm getting in a production server result code 47, MEMCACHED_SERVER_TEMPORARILY_DISABLED, which causes doContains()
to return true
(don't know how to reproduce it on purpose).
from cache.
@Tobion https://github.com/php-memcached-dev/php-memcached/blob/607860c656a3cea22fb164c4eb71d36ec869c598/tests/experimental/getmulti_partial_error.phpt#L23
from cache.
That is a multiget. I already said twice that this ticket is about a simple get returning those states. Please read more carefully. And for multiget it is also documented, see docs.
from cache.
Here are some links to the implementation of get
in the php memcached extension.
return_code
ranges from BAD_KEY_PROVIDED to RES_PAYLOAD_FAILURE to pretty much anything (see implementation of php_memc_handle_error)
from cache.
Does that work?
return false !== $this->memcached->get($id)
|| $this->memcached->getResultCode() !== Memcached::RES_SUCCESS;
from cache.
In libmemcached a result can be returned only if RES_SUCCESS is true, so it should be correct. I find the first part of the expression misleading because we don't care about the returned value and false
is a legitimate result. I'd write it differently because it's easier to reason about, but maybe that's just me.
$this->memcached->get($id);
return $this->memcached->getResultCode() === Memcached::RES_SUCCESS;
edit: in your code you should compare Memcached::RES_SUCCESS
for equality, not !==
from cache.
👍
We're faced to the same issue.
from cache.
A fix was provided via #181, but no tests are there, so I cannot merge it.
from cache.
Related Issues (20)
- CI doesn't have PHP 7.3 in the matrix HOT 2
- Support RedisCluster? HOT 3
- mkdir is affected by default `umask()` setting HOT 1
- Suggestion: Refactor code to replace the name "cache" as a directory name HOT 1
- compression? HOT 1
- Sunsetting doctrine/cache HOT 15
- Lazy Redis connection HOT 2
- The typehint for the CacheAdapter constructor is wrong HOT 2
- Is there a docs for v2? HOT 2
- Cache namespace from Setup::createCacheConfiguration gets lost
- Crash in Doctrine/ORM/Tools/Setup/createCacheInstance() after composer update HOT 4
- Performance degradation due to subsequent commit of deferredItems in PSR6 CacheAdapter HOT 8
- 1.12.1 and PHP7 breaking compatibility HOT 16
- Required PHP Version is Incorrect HOT 4
- PHP语法报错 HOT 1
- mark doctrine/cache as abandoned on packagist? HOT 1
- SonarQube Blocker Bug HOT 6
- Not working with symfony/cache v 6.1.1 HOT 10
- Release v3 as a bridge to Laminas or Symfony Cache HOT 6
- Incorrect "mixed" type hint in TypedCacheItem HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cache.