Php-couch base SDK vs php-ext-couchbase

I would like to use php-ext-couchbase as it has more functions to choose from but it appears to be older on Github. Is one more official than the other?

Please More explain your question

I guess @fnsnoop is asking about the difference between which is place where 1.x SDK lives and which is new 2.0 series of PHP SDK

Thats the question, I am confused why the newer version doesnt have all the functions that the old one has. I am very interested in the setMulti() function.

I am also receiving some odd errors on the newer version. Every 8 or so gets on the same key, I receive this error.

Warning: Invalid callback , no array or string given in CouchbaseNative on line 1111

I think this is because I am running PHP 5.3 on a 64 bit system.

Hey fnsnoop,

What kind of operations were you looking for that existed in the PHP 1.x series of client, but which is missing from the 2.x series? Additionally, can you post an example of your code which causes the periodic callback error?

Cheers, Brett

I would like to insert more than 1 document at a time with a set command. The 1.x series has a setMulti().

My code for getting the error below.

$cluster = new CouchbaseCluster('','','');
$bucket = $cluster->openBucket('default');
$value = $bucket->get("key here");

echo "<pre>";
echo "</pre>";

Hey fnsnoop,

This is still possible, it’s just rolled into the main set of operations, for instance:

  'key1' => 'value1',
  'key2' => 'value2'

Cheers, Brett

I have tried this and both keys get inserted but the values dont make it. The values shows up as null.

Hey fnsoop,

I sincerely apologize, I forgot a level of array there:

  'key1' => array('value' => 'value1'),
  'key2' => array('value' => 'value2')

The additional level exists as you can specify various operation options on a per-key basis.

Cheers, Brett


Could I question regarding this?

Is it possible with CAS value?

Actually, I’m looking for a solution like this.

But not easy to find any reference from newest document.

Could you please help on this as well?


Hey ronpark,

You can put a CAS value as the ‘cas’ key of the inner array (alongside value).

Cheers, Brett

Ok. Let me try it as you mentioned.
And ask you later if I have other problem. :smiley:

Many thanks for kindly help.