@@ -28,7 +28,7 @@ the second and third parameters::
28
28
29
29
$cache = new CouchbaseBucketAdapter(
30
30
// the client object that sets options and adds the server instance(s)
31
- \CouchbaseCluster $client,
31
+ \CouchbaseBucket $client,
32
32
33
33
// the name of bucket
34
34
string $bucket,
@@ -37,32 +37,11 @@ the second and third parameters::
37
37
$namespace = '',
38
38
39
39
// the default lifetime (in seconds) for cache items that do not define their
40
- // own lifetime, with a value 0 causing items to be stored indefinitely (i.e.
41
- // until MemcachedAdapter::clear() is invoked or the server(s) are restarted)
40
+ // own lifetime, with a value 0 causing items to be stored indefinitely
42
41
$defaultLifetime = 0,
43
-
44
- // associative array of configuration options
45
- array $options = [
46
- 'operationTimeout' => 10,
47
- 'configTimeout' => 5,
48
- 'configNodeTimeout' => 20,
49
- ]
50
42
);
51
43
52
44
53
- Available Options
54
- ~~~~~~~~~~~~~~~~~
55
-
56
- ``operationTimeout `` (type: ``int ``, default: ``2500000 ``)
57
- The operation timeout (in microseconds) is the maximum amount of time the library will
58
- wait for an operation to receive a response before invoking its callback with a failure status.
59
-
60
- ``configTimeout `` (type: ``int ``, default: ``5000000 ``)
61
- How long (in microseconds) the client will wait to obtain the initial configuration.
62
-
63
- ``configNodeTimeout `` (type: ``int ``, default: ``2000000 ``)
64
- Per-node configuration timeout (in microseconds).
65
-
66
45
Configure the Connection
67
46
------------------------
68
47
@@ -72,8 +51,16 @@ helper method allows creating and configuring a `Couchbase Bucket`_ class instan
72
51
73
52
use Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter;
74
53
54
+ // pass a single DSN string to register a single server with the client
55
+ $client = CouchbaseBucketAdapter::createConnection(
56
+ 'couchbase://localhost'
57
+ // the DSN can include config options (pass them as a query string):
58
+ // 'couchbase://localhost:11210?operationTimeout=10'
59
+ // 'couchbase://localhost:11210?operationTimeout=10&configTimout=20'
60
+ );
61
+
75
62
// pass an array of DSN strings to register multiple servers with the client
76
- $client = MemcachedAdapter ::createConnection([
63
+ $client = CouchbaseBucketAdapter ::createConnection([
77
64
'couchbase://10.0.0.100',
78
65
'couchbase://10.0.0.101',
79
66
'couchbase://10.0.0.102',
@@ -82,8 +69,8 @@ helper method allows creating and configuring a `Couchbase Bucket`_ class instan
82
69
83
70
// a single DSN can define multiple servers using the following syntax:
84
71
// host[hostname-or-IP:port] (where port is optional). Sockets must include a trailing ':'
85
- $client = MemcachedAdapter ::createConnection(
86
- 'couchbase:?host[localhost]&host[localhost:12345]&host[/some/memcached.sock:]=3 '
72
+ $client = CouchbaseBucketAdapter ::createConnection(
73
+ 'couchbase:?host[localhost]&host[localhost:12345]'
87
74
);
88
75
89
76
@@ -97,14 +84,15 @@ option names and their respective values::
97
84
98
85
use Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter;
99
86
100
- $client = MemcachedAdapter ::createConnection(
87
+ $client = CouchbaseBucketAdapter ::createConnection(
101
88
// a DSN string or an array of DSN strings
102
89
[],
103
90
104
91
// associative array of configuration options
105
92
[
106
93
'username' => 'xxxxxx',
107
94
'password' => 'yyyyyy',
95
+ 'configTimeout' => '100',
108
96
]
109
97
);
110
98
@@ -117,18 +105,46 @@ Available Options
117
105
``password `` (type: ``string ``, default: ````)
118
106
Password of connection ``CouchbaseCluster ``.
119
107
108
+ ``operationTimeout `` (type: ``int ``, default: ``2500000 ``)
109
+ The operation timeout (in microseconds) is the maximum amount of time the library will
110
+ wait for an operation to receive a response before invoking its callback with a failure status.
111
+
112
+ ``configTimeout `` (type: ``int ``, default: ``5000000 ``)
113
+ How long (in microseconds) the client will wait to obtain the initial configuration.
114
+
115
+ ``configNodeTimeout `` (type: ``int ``, default: ``2000000 ``)
116
+ Per-node configuration timeout (in microseconds).
117
+
118
+ ``viewTimeout `` (type: ``int ``, default: ``75000000 ``)
119
+ The I/O timeout (in microseconds) for HTTP requests to Couchbase Views API.
120
+
121
+ ``httpTimeout `` (type: ``int ``, default: ``75000000 ``)
122
+ The I/O timeout (in microseconds) for HTTP queries (management API).
123
+
124
+ ``configDelay `` (type: ``int ``, default: ``10000 ``)
125
+ Config refresh throttling
126
+ Modify the amount of time (in microseconds) before the configiration error threshold will forcefully be set to its maximum number forcing a configuration refresh.
127
+
128
+ ``htconfigIdleTimeout `` (type: ``int ``, default: ``4294967295 ``)
129
+ Idling/Persistence for HTTP bootstrap (in microseconds).
130
+
131
+ ``durabilityInterval `` (type: ``int ``, default: ``100000 ``)
132
+ The time (in microseconds) the client will wait between repeated probes to a given server.
133
+
134
+ ``durabilityTimeout `` (type: ``int ``, default: ``5000000 ``)
135
+ The time (in microseconds) the client will spend sending repeated probes to a given key's vBucket masters and replicas before they are deemed not to have satisfied the durability requirements.
120
136
121
137
.. tip ::
122
138
123
- Reference the `Memcached `_ extension's `predefined constants `_ documentation
139
+ Reference the `Couchbase Bucket `_ extension's `predefined constants `_ documentation
124
140
for additional information about the available options.
125
141
126
142
.. _`Transmission Control Protocol (TCP)` : https://en.wikipedia.org/wiki/Transmission_Control_Protocol
127
143
.. _`User Datagram Protocol (UDP)` : https://en.wikipedia.org/wiki/User_Datagram_Protocol
128
144
.. _`no-delay` : https://en.wikipedia.org/wiki/TCP_NODELAY
129
145
.. _`keep-alive` : https://en.wikipedia.org/wiki/Keepalive
130
146
.. _`Couchbase PHP extension` : https://docs.couchbase.com/sdk-api/couchbase-php-client-2.6.0/files/couchbase.html
131
- .. _`predefined constants` : http ://php.net/manual/en/memcached.constants.php
147
+ .. _`predefined constants` : https ://docs.couchbase.com/sdk-api/couchbase-php-client-2.6.0/classes/Couchbase.Bucket.html
132
148
.. _`Couchbase server` : https://couchbase.com/
133
149
.. _`Couchbase Bucket` : https://docs.couchbase.com/sdk-api/couchbase-php-client-2.6.0/classes/Couchbase.Bucket.html
134
150
.. _`Data Source Name (DSN)` : https://en.wikipedia.org/wiki/Data_source_name
0 commit comments