diff --git a/Couchbase/ClusterOptions.php b/Couchbase/ClusterOptions.php index b99a8811..4cd462a7 100644 --- a/Couchbase/ClusterOptions.php +++ b/Couchbase/ClusterOptions.php @@ -54,6 +54,7 @@ class ClusterOptions private ?bool $enableTracing = null; private ?bool $enableUnorderedExecution = null; private ?bool $showQueries = null; + private ?bool $enableLazyConnections = null; private ?string $network = null; private ?string $trustCertificate = null; @@ -546,6 +547,20 @@ public function getTransactionsConfiguration(): ?TransactionsConfiguration return $this->transactionsConfiguration; } + /** + * @param bool $enable + * + * @return ClusterOptions + * @since 4.5.0 + * + * @VOLATILE: This API is subject to change at any time. + */ + public function enableLazyConnections(bool $enable): ClusterOptions + { + $this->enableLazyConnections = $enable; + return $this; + } + /** * @return string the string that uniquely identifies particular authenticator layout * @throws InvalidArgumentException @@ -610,6 +625,7 @@ public function export(): array 'enableUnorderedExecution' => $this->enableUnorderedExecution, 'useIpProtocol' => $this->useIpProtocol, 'showQueries' => $this->showQueries, + 'enableLazyConnections' => $this->enableLazyConnections, 'network' => $this->network, 'trustCertificate' => $this->trustCertificate, diff --git a/bin/package.rb b/bin/package.rb index 040076f6..adba41b4 100755 --- a/bin/package.rb +++ b/bin/package.rb @@ -59,6 +59,7 @@ def which(name, extra_locations = []) cmake_flags = [ "-S#{cxx_core_source_dir}", "-B#{cxx_core_build_dir}", + "-DCOUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY=OFF", "-DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF", "-DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=OFF", "-DCOUCHBASE_CXX_CLIENT_BUILD_DOCS=OFF", @@ -170,6 +171,7 @@ def which(name, extra_locations = []) cmake_flags = [ "-S#{cxx_core_source_dir}", "-B#{cxx_core_build_dir}", + "-DCOUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY=OFF", "-DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF", "-DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=OFF", "-DCOUCHBASE_CXX_CLIENT_BUILD_DOCS=OFF", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f363ea2..85da85c3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,6 +21,9 @@ string( set(COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID "php/${CMAKE_MATCH_1}" CACHE STRING "" FORCE) +set(COUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY + OFF + CACHE BOOL "" FORCE) set(COUCHBASE_CXX_CLIENT_BUILD_DOCS OFF CACHE BOOL "" FORCE) diff --git a/src/deps/couchbase-cxx-client b/src/deps/couchbase-cxx-client index ad4836b5..5bbe6769 160000 --- a/src/deps/couchbase-cxx-client +++ b/src/deps/couchbase-cxx-client @@ -1 +1 @@ -Subproject commit ad4836b55aedb1d475d5e87514f27f630d00913e +Subproject commit 5bbe676932704bb723e7a1abeb5023d6d65f1845 diff --git a/src/wrapper/connection_handle.cxx b/src/wrapper/connection_handle.cxx index 375e21f1..9047e4b3 100644 --- a/src/wrapper/connection_handle.cxx +++ b/src/wrapper/connection_handle.cxx @@ -25,6 +25,7 @@ #include "passthrough_transcoder.hxx" #include "version.hxx" +#define COUCHBASE_CXX_CLIENT_IGNORE_CORE_DEPRECATIONS #include #include #include @@ -32,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -3630,9 +3632,7 @@ zval_to_bucket_settings(const zval* bucket_settings) return { e, {} }; } - if (auto e = cb_assign_integer( - bucket.num_vbuckets, bucket_settings, "numVBuckets"); - e.ec) { + if (auto e = cb_assign_integer(bucket.num_vbuckets, bucket_settings, "numVBuckets"); e.ec) { return { e, {} }; } @@ -3828,8 +3828,7 @@ cb_bucket_settings_to_zval( } if (bucket_settings.num_vbuckets.has_value()) { - add_assoc_long( - return_value, "numVBuckets", bucket_settings.num_vbuckets.value()); + add_assoc_long(return_value, "numVBuckets", bucket_settings.num_vbuckets.value()); } return {}; @@ -6067,6 +6066,9 @@ apply_options(couchbase::cluster_options& cluster_options, zval* options) -> cor options::assign_boolean(ZEND_STRL("enableTcpKeepAlive"), key, value, [&](auto v) { cluster_options.network().enable_tcp_keep_alive(v); }); + options::assign_boolean(ZEND_STRL("enableLazyConnections"), key, value, [&](auto v) { + cluster_options.network().enable_lazy_connections(v); + }); options::assign_boolean(ZEND_STRL("enableUnorderedExecution"), key, value, [&](auto v) { cluster_options.behavior().enable_unordered_execution(v); }); @@ -6223,7 +6225,8 @@ apply_options(couchbase::cluster_options& cluster_options, zval* options) -> cor ZEND_HASH_FOREACH_END(); } - if (zend_binary_strcmp(ZSTR_VAL(key), ZSTR_LEN(key), ZEND_STRL("appTelemetryConfiguration")) == 0) { + if (zend_binary_strcmp( + ZSTR_VAL(key), ZSTR_LEN(key), ZEND_STRL("appTelemetryConfiguration")) == 0) { if (value == nullptr || Z_TYPE_P(value) == IS_NULL) { continue; }