/** * Constructs a connection to a bucket. * * @param string $name The name of the bucket to open. * @param string $password The bucket password to authenticate with. * @return CouchbaseBucket A bucket object. * * @throws CouchbaseException * * @see CouchbaseBucket CouchbaseBucket */ public function openBucket($name = 'default', $password = '') { $bucketDsn = cbdsn_normalize($this->_dsn); $bucketDsn['bucket'] = $name; $dsnStr = cbdsn_stringify($bucketDsn); return new CouchbaseBucket($dsnStr, $name, $password); }
/** * Constructs a connection to a bucket. * * @param string $name The name of the bucket to open. * @param string $password The bucket password to authenticate with. * @return CouchbaseBucket A bucket object. * * @throws CouchbaseException * * @see CouchbaseBucket CouchbaseBucket */ public function openBucket($name = 'default', $password = '') { $bucketDsn = cbdsn_normalize($this->_dsn); $bucketDsn['bucket'] = $name; if (!$password && $this->authenticator) { $password = $this->authenticator->getCredentials('bucket-kv', $name); } $dsnStr = cbdsn_stringify($bucketDsn); return new CouchbaseBucket($dsnStr, $name, $password, $this->authenticator); }