Skip to content

Commit a95384f

Browse files
authored
Merge pull request phpredis#1965 from phpredis/issue-1894-client-info
[WIP] Issue phpredis#1894
2 parents 37a9025 + 3c40582 commit a95384f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

redis.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3489,6 +3489,7 @@ PHP_METHOD(Redis, getAuth) {
34893489

34903490
/*
34913491
* $redis->client('list');
3492+
* $redis->client('info');
34923493
* $redis->client('kill', <ip:port>);
34933494
* $redis->client('setname', <name>);
34943495
* $redis->client('getname');
@@ -3529,6 +3530,11 @@ PHP_METHOD(Redis, client) {
35293530
redis_client_list_reply(INTERNAL_FUNCTION_PARAM_PASSTHRU,redis_sock, NULL, NULL);
35303531
}
35313532
REDIS_PROCESS_RESPONSE(redis_client_list_reply);
3533+
} else if (!strncasecmp(opt, "info", 4)) {
3534+
if (IS_ATOMIC(redis_sock)) {
3535+
redis_string_response(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, NULL, NULL);
3536+
}
3537+
REDIS_PROCESS_RESPONSE(redis_string_response);
35323538
} else {
35333539
if (IS_ATOMIC(redis_sock)) {
35343540
redis_read_variant_reply(INTERNAL_FUNCTION_PARAM_PASSTHRU,

tests/RedisTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,8 +1971,13 @@ public function testClient() {
19711971
/* CLIENT GETNAME */
19721972
$this->assertTrue($this->redis->client('getname'), 'phpredis_unit_tests');
19731973

1974+
if (version_compare($this->version, "6.2.0") >= 0) {
1975+
$this->assertFalse(empty($this->redis->client('info')));
1976+
}
1977+
19741978
/* CLIENT KILL -- phpredis will reconnect, so we can do this */
19751979
$this->assertTrue($this->redis->client('kill', $str_addr));
1980+
19761981
}
19771982

19781983
public function testSlowlog() {

0 commit comments

Comments
 (0)