Skip to content

Commit 10e4627

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents df6b081 + 1ec8c8e commit 10e4627

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 2.6.3
4+
5+
- Switch to `E_USER_DEPRECATED` instead of `_doing_it_wrong()` in drop-in
6+
- Fixed `undefined constant` error when using Credis (deprecated) as client
7+
38
## 2.6.2
49

510
- Fixed more PHP 7.2 heredoc parsing errors

includes/object-cache.php

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Redis Object Cache Drop-In
44
* Plugin URI: https://wordpress.org/plugins/redis-cache/
55
* Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.
6-
* Version: 2.6.2
6+
* Version: 2.6.3
77
* Author: Till Krüss
88
* Author URI: https://objectcache.pro
99
* License: GPLv3
@@ -518,10 +518,8 @@ public function __construct( $fail_gracefully = false ) {
518518

519519
$this->cache_group_types();
520520

521-
if ( function_exists( '_doing_it_wrong' ) ) {
522-
if ( defined( 'WP_REDIS_TRACE' ) && WP_REDIS_TRACE ) {
523-
_doing_it_wrong( __FUNCTION__ , 'Tracing feature was removed.' , '2.1.2' );
524-
}
521+
if ( defined( 'WP_REDIS_TRACE' ) && WP_REDIS_TRACE ) {
522+
trigger_error('Tracing feature was removed', E_USER_DEPRECATED);
525523
}
526524

527525
$client = $this->determine_client();
@@ -758,9 +756,7 @@ protected function connect_using_phpredis( $parameters ) {
758756
if ( defined( 'WP_REDIS_SERIALIZER' ) && ! empty( WP_REDIS_SERIALIZER ) ) {
759757
$this->redis->setOption( Redis::OPT_SERIALIZER, WP_REDIS_SERIALIZER );
760758

761-
if ( function_exists( '_doing_it_wrong' ) ) {
762-
_doing_it_wrong( __FUNCTION__ , 'The `WP_REDIS_SERIALIZER` configuration constant has been deprecated, use `WP_REDIS_IGBINARY` instead.', '2.3.1' );
763-
}
759+
trigger_error('The `WP_REDIS_SERIALIZER` configuration constant has been deprecated in favor of `WP_REDIS_IGBINARY`', E_USER_DEPRECATED);
764760
}
765761
}
766762

@@ -834,9 +830,7 @@ protected function connect_using_relay( $parameters ) {
834830
if ( defined( 'WP_REDIS_SERIALIZER' ) && ! empty( WP_REDIS_SERIALIZER ) ) {
835831
$this->redis->setOption( Relay\Relay::OPT_SERIALIZER, WP_REDIS_SERIALIZER );
836832

837-
if ( function_exists( '_doing_it_wrong' ) ) {
838-
_doing_it_wrong( __FUNCTION__ , 'The `WP_REDIS_SERIALIZER` configuration constant has been deprecated, use `WP_REDIS_IGBINARY` instead.', '2.3.1' );
839-
}
833+
trigger_error('The `WP_REDIS_SERIALIZER` configuration constant has been deprecated in favor of `WP_REDIS_IGBINARY`', E_USER_DEPRECATED);
840834
}
841835
}
842836

@@ -948,11 +942,11 @@ protected function connect_using_predis( $parameters ) {
948942
* @param array $parameters Connection parameters built by the `build_parameters` method.
949943
* @throws \Exception If the Credis library was not found or is unreadable.
950944
* @throws \Exception If redis sharding should be configured as Credis does not support sharding.
951-
* @throws \Exception If more than one seninel is configured as Credis does not support multiple sentinel servers.
945+
* @throws \Exception If more than one sentinel is configured as Credis does not support multiple sentinel servers.
952946
* @return void
953947
*/
954948
protected function connect_using_credis( $parameters ) {
955-
_doing_it_wrong( __FUNCTION__ , 'Credis support will be removed in future versions.' , '2.0.26' );
949+
trigger_error( 'Credis support is deprecated and will be removed in the future', E_USER_DEPRECATED );
956950

957951
$client = 'Credis';
958952

@@ -1079,7 +1073,7 @@ protected function connect_using_credis( $parameters ) {
10791073
}
10801074

10811075
$this->diagnostics = array_merge(
1082-
[ 'client' => sprintf( '%s (v%s)', $client, Credis_Client::VERSION ) ],
1076+
[ 'client' => sprintf( '%s (%s)', $client, 'bundled' ) ],
10831077
$args
10841078
);
10851079
}
@@ -1091,7 +1085,7 @@ protected function connect_using_credis( $parameters ) {
10911085
* @return void
10921086
*/
10931087
protected function connect_using_hhvm( $parameters ) {
1094-
_doing_it_wrong( __FUNCTION__ , 'HHVM support will be removed in future versions.' , '2.0.26' );
1088+
trigger_error('HHVM support is deprecated and will be removed in the future', E_USER_DEPRECATED);
10951089

10961090
$this->redis = new Redis();
10971091

phpstan.dist.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ parameters:
6161
count: 1
6262
path: includes/ui/settings.php
6363

64-
# False positive
65-
-
66-
message: "#^Access to undefined constant Credis_Client::VERSION#"
67-
count: 1
68-
path: tests/PHPStan/object-cache.php
69-
7064
# whatever
7165
-
7266
message: "#^Call to an undefined method Credis_Sentinel::getCluster#"

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: redis, object cache, caching, performance, relay
55
Requires at least: 4.6
66
Tested up to: 6.8
77
Requires PHP: 7.2
8-
Stable tag: 2.6.2
8+
Stable tag: 2.6.3
99
License: GPLv3
1010
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1111

@@ -61,6 +61,11 @@ Redis Object Cache has various WP CLI commands, for more information run `wp hel
6161

6262
== Changelog ==
6363

64+
= 2.6.3 =
65+
66+
- Switch to `E_USER_DEPRECATED` instead of `_doing_it_wrong()` in drop-in
67+
- Fixed error when using Credis (deprecated) as client
68+
6469
= 2.6.2 =
6570

6671
- Fixed more PHP 7.2 heredoc parsing errors

redis-cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Redis Object Cache
44
* Plugin URI: https://wordpress.org/plugins/redis-cache/
55
* Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.
6-
* Version: 2.6.2
6+
* Version: 2.6.3
77
* Text Domain: redis-cache
88
* Domain Path: /languages
99
* Network: true

0 commit comments

Comments
 (0)