Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 1.8.x

Undefined class constant 'RES_NOTFOUND'

5 replies [Last post]
  • Login or register to post comments
Tue, 02/07/2012 - 22:10
ismtlee
Offline
Joined: 10/12/2011
Groups: None

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' ...

Top
  • Login or register to post comments
Wed, 02/08/2012 - 07:29
jan
Offline
Joined: 02/15/2011
Groups: None

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

Top
  • Login or register to post comments
Wed, 02/08/2012 - 23:44
ismtlee
Offline
Joined: 10/12/2011
Groups: None

Hi jan,
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?

Top
  • Login or register to post comments
Thu, 02/09/2012 - 10:15
jan
Offline
Joined: 02/15/2011
Groups: None

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.

Cheers
Jan
--

Top
  • Login or register to post comments
Thu, 02/09/2012 - 20:24
ismtlee
Offline
Joined: 10/12/2011
Groups: None

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?

Best wishes!

Top
  • Login or register to post comments
Fri, 02/10/2012 - 04:08
jan
Offline
Joined: 02/15/2011
Groups: None

I'll be fixing the docs :)

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker