Advertisement
Guest User

Couchbase crash

a guest
Jan 3rd, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. $data = ['a' => 'b', 'c' => ['d' => 'e']];
  4.  
  5. $cluster = new \CouchbaseCluster('couchbase://127.0.0.1');
  6.  
  7. $bucket = $cluster->openBucket('default');
  8.  
  9. $bucket->setTranscoder(function($value) {
  10.   throw new \Exception();
  11.   return array(serialize($value), 0, 0);
  12. }, function($value, $flags, $datatype) {
  13.   return unserialize($value);
  14. });
  15.  
  16. $bucket->upsert('cid', $data);
  17.  
  18. $info = $bucket->get('cid', $data);
  19.  
  20. $a = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement