From e661cb9588eb1b0b8fd5c8c54d6eed15eed4439f Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Tue, 22 Aug 2017 12:52:00 -0700 Subject: [PATCH 1/4] Disable environment deletion on Circle failure --- bin/behat-cleanup.sh | 2 ++ bin/behat-test.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bin/behat-cleanup.sh b/bin/behat-cleanup.sh index 99f6d8e..d8ae90d 100755 --- a/bin/behat-cleanup.sh +++ b/bin/behat-cleanup.sh @@ -10,6 +10,8 @@ if [ $? -ne 0 ]; then exit 0 fi +exit 0; + set -ex if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then diff --git a/bin/behat-test.sh b/bin/behat-test.sh index eaf7dad..551a06d 100755 --- a/bin/behat-test.sh +++ b/bin/behat-test.sh @@ -10,6 +10,8 @@ if [ $? -ne 0 ]; then exit 0 fi +exit 0; + if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then echo "TERMINUS_SITE and TERMINUS_ENV environment variables must be set" exit 1 From f1c91a0f0a5b529a9ccfc6a48d3576ba85f11fc8 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Tue, 22 Aug 2017 13:11:00 -0700 Subject: [PATCH 2/4] Pass through and correctly access `$client_parameters` argument --- object-cache.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/object-cache.php b/object-cache.php index 0b4eafb..9c20045 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1016,7 +1016,7 @@ protected function _connect_redis() { * @param callable $setup_connection Callback to execute. */ $setup_connection = apply_filters( 'wp_redis_perform_client_connection_callback', $setup_connection ); - call_user_func_array( $setup_connection, array( $this->redis, $redis_server, $keys_methods ) ); + call_user_func_array( $setup_connection, array( $this->redis, $client_parameters, $keys_methods ) ); } catch ( Exception $e ) { $this->_exception_handler( $e ); } @@ -1118,12 +1118,12 @@ public function prepare_client_connection( $client_parameters ) { * @return bool True if successful. */ public function perform_client_connection( $redis, $client_parameters, $keys_methods ) { - foreach ( $keys_methods as $k => $method ) { - if ( ! isset( $client_parameters[ $k ] ) ) { + foreach ( $keys_methods as $method ) { + if ( ! isset( $client_parameters[ $method ] ) ) { continue; } try { - $redis->$method( $client_parameters[ $k ] ); + $redis->$method( $client_parameters[ $method ] ); } catch ( RedisException $e ) { // PhpRedis throws an Exception when it fails a server call. From a9f2a1791da26f37dcc4f953589af57483965244 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Tue, 22 Aug 2017 13:12:29 -0700 Subject: [PATCH 3/4] Revert "Disable environment deletion on Circle failure" This reverts commit e661cb9588eb1b0b8fd5c8c54d6eed15eed4439f. --- bin/behat-cleanup.sh | 2 -- bin/behat-test.sh | 2 -- 2 files changed, 4 deletions(-) diff --git a/bin/behat-cleanup.sh b/bin/behat-cleanup.sh index d8ae90d..99f6d8e 100755 --- a/bin/behat-cleanup.sh +++ b/bin/behat-cleanup.sh @@ -10,8 +10,6 @@ if [ $? -ne 0 ]; then exit 0 fi -exit 0; - set -ex if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then diff --git a/bin/behat-test.sh b/bin/behat-test.sh index 551a06d..eaf7dad 100755 --- a/bin/behat-test.sh +++ b/bin/behat-test.sh @@ -10,8 +10,6 @@ if [ $? -ne 0 ]; then exit 0 fi -exit 0; - if [ -z "$TERMINUS_SITE" ] || [ -z "$TERMINUS_ENV" ]; then echo "TERMINUS_SITE and TERMINUS_ENV environment variables must be set" exit 1 From 046a01ce09aa33974c729898cdb1b643024cff4e Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Tue, 22 Aug 2017 13:14:23 -0700 Subject: [PATCH 4/4] Use the correct key/method combo --- object-cache.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/object-cache.php b/object-cache.php index 9c20045..0ce2567 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1118,12 +1118,12 @@ public function prepare_client_connection( $client_parameters ) { * @return bool True if successful. */ public function perform_client_connection( $redis, $client_parameters, $keys_methods ) { - foreach ( $keys_methods as $method ) { - if ( ! isset( $client_parameters[ $method ] ) ) { + foreach ( $keys_methods as $key => $method ) { + if ( ! isset( $client_parameters[ $key ] ) ) { continue; } try { - $redis->$method( $client_parameters[ $method ] ); + $redis->$method( $client_parameters[ $key ] ); } catch ( RedisException $e ) { // PhpRedis throws an Exception when it fails a server call.