★ wanayoo — archive 1999 https://github.com/phpredis/phpredis/pull/1279Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the element of z_seeds may be a reference on php7 #1279

Closed
wants to merge 2 commits into from

Conversation

@janic716
Copy link

janic716 commented Dec 5, 2017

yesterday i used RedisCluster connect my redis cluser, code like this:
$hosts = [
"10.1.15.22:7100",
"10.1.15.22:7101",
];
array_walk($hosts, function(&$val) {
$val = trim($val);
});
$rc = new RedisCluster(null, $hosts, null, null, true);

this code runs normally on php5.x but error on php7.x, error info is:
PHP Fatal error: Uncaught RedisClusterException: Couldn't map cluster keyspace using any provided seed in /opt/php/test.php:14
Stack trace:
#0 /opt/php/test.php(14): RedisCluster->__construct(NULL, Array, NULL, NULL, true)
#1 {main}
thrown in /opt/php/test.php on line 14

tracing the source code of phpredis, i found the element of ht_seeds is a referent in function cluster_init_seeds on php7.x environment.

i fixed this problem and re-compiled the redis extension, and the code runs normally on php7

@yatsukhnenko
Copy link
Member

yatsukhnenko commented Dec 6, 2017

@janic716, thank you for your RP. Could you rewrite code using ZVAL_DEREF macro?

@janic716
Copy link
Author

janic716 commented Dec 6, 2017

sure, thanks for the tip

@yatsukhnenko
Copy link
Member

yatsukhnenko commented Dec 6, 2017

@janic716 👍 Could you also sqash your commits into one?

@janic716
Copy link
Author

janic716 commented Dec 6, 2017

@yatsukhnenko , i tried to rebase last 3 commits to one , but i dont know whether it works ......
maybe my operation is not correct

@yatsukhnenko
Copy link
Member

yatsukhnenko commented Dec 6, 2017

@janic716 I want you to make single commit

compatible with php5

use ZVAL_DEREF macro
@janic716 janic716 force-pushed the janic716:develop branch from f8acc20 to 3166cb6 Dec 6, 2017
@janic716
Copy link
Author

janic716 commented Dec 6, 2017

i'm so sorry, i made a mistake when sqashing my commits
i will close this pull request and create new one

@janic716 janic716 closed this Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.