diff --git a/.circleci/config.yml b/.circleci/config.yml index 1cd5e74..8ef60b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,12 +113,12 @@ jobs: name: "Run Tests" command: | bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest - composer phpunit - WP_MULTISITE=1 composer phpunit - WP_REDIS_USE_CACHE_GROUPS=1 composer phpunit + composer phpunit -d memory_limit=4G + WP_MULTISITE=1 composer phpunit -d memory_limit=4G + WP_REDIS_USE_CACHE_GROUPS=1 composer phpunit -d memory_limit=4G rm -rf $WP_TESTS_DIR $WP_CORE_DIR bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 nightly true - composer phpunit + composer phpunit -d memory_limit=4G test-phpunit-redis-enabled: working_directory: ~/pantheon-systems/wp-redis docker: @@ -154,9 +154,9 @@ jobs: name: "Run Tests" command: | bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest - composer phpunit - WP_MULTISITE=1 composer phpunit - WP_REDIS_USE_CACHE_GROUPS=1 composer phpunit + composer phpunit -d memory_limit=4G + WP_MULTISITE=1 composer phpunit -d memory_limit=4G + WP_REDIS_USE_CACHE_GROUPS=1 composer phpunit -d memory_limit=4G rm -rf $WP_TESTS_DIR $WP_CORE_DIR bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 nightly true - composer phpunit + composer phpunit -d memory_limit=4G diff --git a/object-cache.php b/object-cache.php index 4f04b77..c20156f 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1167,8 +1167,8 @@ public function build_client_parameters( $redis_server ) { if ( isset( $_SERVER['CACHE_HOST'] ) ) { $redis_server = array( 'host' => $_SERVER['CACHE_HOST'], - 'port' => $_SERVER['CACHE_PORT'], - 'auth' => $_SERVER['CACHE_PASSWORD'], + 'port' => ! empty( $_SERVER['CACHE_PORT'] ) ? $_SERVER['CACHE_PORT'] : 6379, + 'auth' => ! empty( $_SERVER['CACHE_PASSWORD'] ) ? $_SERVER['CACHE_PASSWORD'], null, 'database' => isset( $_SERVER['CACHE_DB'] ) ? $_SERVER['CACHE_DB'] : 0, ); } else { diff --git a/wp-redis.php b/wp-redis.php index 5da9639..07af5e1 100644 --- a/wp-redis.php +++ b/wp-redis.php @@ -39,8 +39,8 @@ function wp_redis_get_info() { if ( isset( $_SERVER['CACHE_HOST'] ) ) { $redis_server = array( 'host' => $_SERVER['CACHE_HOST'], - 'port' => $_SERVER['CACHE_PORT'], - 'auth' => $_SERVER['CACHE_PASSWORD'], + 'port' => ! empty( $_SERVER['CACHE_PORT'] ) ? $_SERVER['CACHE_PORT'] : 6379, + 'auth' => ! empty( $_SERVER['CACHE_PASSWORD'] ) ? $_SERVER['CACHE_PASSWORD'], null, 'database' => isset( $_SERVER['CACHE_DB'] ) ? $_SERVER['CACHE_DB'] : 0, ); } else {