Skip to content

Commit 78b70ca

Browse files
More test refactoring.
* Switch remaining old-style PHP 5.4 `Array(...)` declarations to `[...]` * Update variable names getting rid hungarian notation prefixes (e.g. `str_`, `i_`, etc). * Allow cluster seeds to be passed on the command-line instead of soley relying on either a node environment variable or our tests/nodes/nodemap file. This should make it easier to run ad-hoc cluster tests by specifying just a single seed. * Add some diagnostics for when we can't find a suitable cluster to run our tests against indicating exactly where we looked for the env var and node file. * Refactor RedisArray tests to use our newer TestSuite assertions. * Allow `RedisArray` ports to be specified on the command-line as well. * Various formatting fixes. * More robust KeyDB detection.
1 parent 0d89e92 commit 78b70ca

File tree

7 files changed

+904
-829
lines changed

7 files changed

+904
-829
lines changed

arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ For instance, the keys “{user:1}:name” and “{user:1}:email” will be stor
121121
## Custom key distribution function
122122
In order to control the distribution of keys by hand, you can provide a custom function or closure that returns the server number, which is the index in the array of servers that you created the RedisArray object with.
123123

124-
For instance, instantiate a RedisArray object with `new RedisArray(array("us-host", "uk-host", "de-host"), array("distributor" => "dist"));` and write a function called "dist" that will return `2` for all the keys that should end up on the "de-host" server.
124+
For instance, instantiate a RedisArray object with `new RedisArray(["us-host", "uk-host", "de-host"], ["distributor" => "dist"]);` and write a function called "dist" that will return `2` for all the keys that should end up on the "de-host" server.
125125

126126
### Example
127127
<pre>

cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $obj_cluster = new RedisCluster(NULL, ["host:7000", "host:7001"], 1.5, 1.5, true
2424

2525
// Connect with cluster using SSL/TLS
2626
// last argument is an array with [SSL context](https://www.php.net/manual/en/context.ssl.php) options
27-
$obj_cluster = new RedisCluster(NULL, ["host:7000", "host:7001"], 1.5, 1.5, true, NULL, Array("verify_peer" => false));
27+
$obj_cluster = new RedisCluster(NULL, ["host:7000", "host:7001"], 1.5, 1.5, true, NULL, ["verify_peer" => false]);
2828
```
2929

3030
#### Loading a cluster configuration by name

0 commit comments

Comments
 (0)