Does php-ext-couchbase really define constants like Couchbase::RES_NOTFOUND, Couchbase::RES_SUCCESS? When I call the constant above, an error is reported: Undefined class constant 'RES_NOTFOUND' ...
heh, looks like we just pass through the libcouchbase constants and it looks like an oversight on my part. I'm tracking progress here: http://couchbase.com/issues/browse/PCBC-36
Thanks for your reply.
Could we catch couchbase's result code and define the constant by self, such as const RES_NOTFOUND = 13; by now?
const RES_NOTFOUND = 13;
Yeah, but that wouldn't be very nice going forward :)
I proposed a solution in the ticket: http://couchbase.com/issues/browse/PCBC-36
Let me know what you think.
In most cases, we don't care what the actual value of the constant. We can get the meaning by the constant's name, such as RES_NOTFOUND.
The migration from Memcached::RES_NOTFOUND to Couchbase::RES_NOTFOUND is naturally, acceptable.
Via http://www.couchbase.com/docs/couchbase-sdk-php-1.0.pdf, if($cb_obj->getResultCode() == Couchbase::RES_NOTFOUND), I suppose Couchbase should have defined all the constants, but it did not. So I defined myself, it's not nice as you said.
Maybe couchbase defines its own constants, the offical website's reference seems not talking about them, where could I find them？
if($cb_obj->getResultCode() == Couchbase::RES_NOTFOUND)
I'll be fixing the docs :)
© 2013 COUCHBASE All rights reserved.