Skip to content

Commit f52bd8a

Browse files
committed
Fix typos detected by codespell
1 parent db44613 commit f52bd8a

File tree

11 files changed

+35
-35
lines changed

11 files changed

+35
-35
lines changed

README.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ $redis->set('key','value', 10);
738738
// Will set the key, if it doesn't exist, with a ttl of 10 seconds
739739
$redis->set('key', 'value', ['nx', 'ex'=>10]);
740740

741-
// Will set a key, if it does exist, with a ttl of 1000 miliseconds
741+
// Will set a key, if it does exist, with a ttl of 1000 milliseconds
742742
$redis->set('key', 'value', ['xx', 'px'=>1000]);
743743

744744
~~~
@@ -2679,7 +2679,7 @@ $redis->bzPopMax(string $key1, string $key2, ... int $timeout): array
26792679
~~~
26802680

26812681
##### *Return value*
2682-
*ARRAY:* Either an array with the key member and score of the higest or lowest element or an empty array if the timeout was reached without an element to pop.
2682+
*ARRAY:* Either an array with the key member and score of the highest or lowest element or an empty array if the timeout was reached without an element to pop.
26832683

26842684
##### *Example*
26852685
~~~php
@@ -2692,7 +2692,7 @@ $redis->bzPopMax(['zs1', 'zs2'], 5);
26922692
$redis->bzPopMax('zs1', 'zs2', 5);
26932693
~~~
26942694

2695-
**Note:** Calling these functions with an array of keys or with a variable nubmer of arguments is functionally identical.
2695+
**Note:** Calling these functions with an array of keys or with a variable number of arguments is functionally identical.
26962696

26972697
### zAdd
26982698
-----
@@ -2830,7 +2830,7 @@ $redis->zPopMax(string $key, int $count): array
28302830
~~~
28312831

28322832
##### *Return value*
2833-
*ARRAY:* Either an array with the key member and score of the higest or lowest element or an empty array if there is no element available.
2833+
*ARRAY:* Either an array with the key member and score of the highest or lowest element or an empty array if there is no element available.
28342834

28352835
##### *Example*
28362836
~~~php
@@ -3807,7 +3807,7 @@ $obj_redis->xTrim($str_stream, $i_max_len [, $boo_approximate]);
38073807
_**Description**_: Trim the stream length to a given maximum. If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes (this is more efficient).
38083808

38093809
##### *Return value*
3810-
*long*: The number of messages trimed from the stream.
3810+
*long*: The number of messages trimmed from the stream.
38113811

38123812
##### *Example*
38133813
~~~php

arrays.markdown

Lines changed: 2 additions & 2 deletions
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, instanciate 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(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.
125125

126126
### Example
127127
<pre>
@@ -132,7 +132,7 @@ This declares that we started with 2 shards and moved to 4 then 8 shards. The nu
132132

133133
## Migrating keys
134134

135-
When a node is added or removed from a ring, RedisArray instances must be instanciated with a “previous” list of nodes. A single call to `$ra->_rehash()` causes all the keys to be redistributed according to the new list of nodes. Passing a callback function to `_rehash()` makes it possible to track the progress of that operation: the function is called with a node name and a number of keys that will be examined, e.g. `_rehash(function ($host, $count){ ... });`.
135+
When a node is added or removed from a ring, RedisArray instances must be instantiated with a “previous” list of nodes. A single call to `$ra->_rehash()` causes all the keys to be redistributed according to the new list of nodes. Passing a callback function to `_rehash()` makes it possible to track the progress of that operation: the function is called with a node name and a number of keys that will be examined, e.g. `_rehash(function ($host, $count){ ... });`.
136136

137137
It is possible to automate this process, by setting `'autorehash' => TRUE` in the constructor options. This will cause keys to be migrated when they need to be read from the previous array.
138138

cluster.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ For all of these multiple key commands (with the exception of MGET and MSET), th
122122
RedisCluster has specialized processing for MGET and MSET which allows you to send any number of keys (hashing to whichever slots) without having to consider where they live. The way this works, is that the RedisCluster class will split the command as it iterates through keys, delivering a subset of commands per each key's slot.
123123

124124
~~~php
125-
// This will be delivered in two commands. First for all of the {hash1} keys,
125+
// This will be delivered in two commands. First for all of the {hash1} keys,
126126
// and then to grab 'otherkey'
127127
$obj_cluster->mget(Array("{hash1}key1","{hash1}key2","{hash1}key3","otherkey"));
128128
~~~
@@ -183,5 +183,5 @@ The save path for cluster based session storage takes the form of a PHP GET requ
183183
* _distribute_: phpredis will randomly distribute session reads between masters and any attached slaves (load balancing).
184184
* _failover (string)_: How phpredis should distribute session reads between master and slave nodes.
185185
* _none_ : phpredis will only communicate with master nodes
186-
* _error_: phpredis will communicate with master nodes unless one failes, in which case an attempt will be made to read session information from a slave.
186+
* _error_: phpredis will communicate with master nodes unless one fails, in which case an attempt will be made to read session information from a slave.
187187
* _auth (string, empty by default)_: The password used to authenticate with the server prior to sending commands.

cluster_library.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ unsigned short cluster_hash_key(const char *key, int len) {
545545
// Hash the whole key if we don't find a tailing } or if {} is empty
546546
if (e == len || e == s+1) return crc16(key, len) & REDIS_CLUSTER_MOD;
547547

548-
// Hash just the bit betweeen { and }
548+
// Hash just the bit between { and }
549549
return crc16((char*)key+s+1,e-s-1) & REDIS_CLUSTER_MOD;
550550
}
551551

@@ -945,7 +945,7 @@ redisCachedCluster *cluster_cache_create(zend_string *hash, HashTable *nodes) {
945945
return cc;
946946
}
947947

948-
/* Takes our input hash table and returns a straigt C array with elements,
948+
/* Takes our input hash table and returns a straight C array with elements,
949949
* which have been randomized. The return value needs to be freed. */
950950
static zval **cluster_shuffle_seeds(HashTable *seeds, int *len) {
951951
zval **z_seeds, *z_ele;
@@ -1256,7 +1256,7 @@ static int cluster_check_response(redisCluster *c, REDIS_REPLY_TYPE *reply_type
12561256
return -1;
12571257
}
12581258

1259-
// For replies that will give us a numberic length, convert it
1259+
// For replies that will give us a numeric length, convert it
12601260
if (*reply_type != TYPE_LINE) {
12611261
c->reply_len = strtol(c->line_reply, NULL, 10);
12621262
} else {
@@ -1593,7 +1593,7 @@ PHP_REDIS_API short cluster_send_command(redisCluster *c, short slot, const char
15931593
msstart = mstime();
15941594

15951595
/* Our main cluster request/reply loop. This loop runs until we're able to
1596-
* get a valid reply from a node, hit our "request" timeout, or enounter a
1596+
* get a valid reply from a node, hit our "request" timeout, or encounter a
15971597
* CLUSTERDOWN state from Redis Cluster. */
15981598
do {
15991599
/* Send MULTI to the socket if we're in MULTI mode but haven't yet */
@@ -2046,7 +2046,7 @@ cluster_variant_resp_generic(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
20462046
CLUSTER_RETURN_FALSE(c);
20472047
}
20482048

2049-
// Handle ATOMIC vs. MULTI mode in a seperate switch
2049+
// Handle ATOMIC vs. MULTI mode in a separate switch
20502050
if (CLUSTER_IS_ATOMIC(c)) {
20512051
switch(r->type) {
20522052
case TYPE_INT:
@@ -2434,7 +2434,7 @@ PHP_REDIS_API void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
24342434
mbulk_resp_loop(c->cmd_sock, mctx->z_multi, c->reply_len, NULL) == FAILURE;
24352435

24362436
// If we had a failure, pad results with FALSE to indicate failure. Non
2437-
// existant keys (e.g. for MGET will come back as NULL)
2437+
// existent keys (e.g. for MGET will come back as NULL)
24382438
if (fail) {
24392439
while (mctx->count--) {
24402440
add_next_index_bool(mctx->z_multi, 0);
@@ -2655,7 +2655,7 @@ int mbulk_resp_loop_zipstr(RedisSock *redis_sock, zval *z_result,
26552655
int line_len, key_len = 0;
26562656
long long idx = 0;
26572657

2658-
// Our count wil need to be divisible by 2
2658+
// Our count will need to be divisible by 2
26592659
if (count % 2 != 0) {
26602660
return -1;
26612661
}

cluster_library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void cluster_multi_fini(clusterMultiCmd *mc);
363363
unsigned short cluster_hash_key_zval(zval *key);
364364
unsigned short cluster_hash_key(const char *key, int len);
365365

366-
/* Get the current time in miliseconds */
366+
/* Get the current time in milliseconds */
367367
long long mstime(void);
368368

369369
PHP_REDIS_API short cluster_send_command(redisCluster *c, short slot, const char *cmd,

library.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ union resparg {
574574
};
575575

576576
/* A printf like method to construct a Redis RESP command. It has been extended
577-
* to take a few different format specifiers that are convienient to phpredis.
577+
* to take a few different format specifiers that are convenient to phpredis.
578578
*
579579
* s - C string followed by length as a
580580
* S - Pointer to a zend_string
@@ -1274,7 +1274,7 @@ redis_read_stream_messages(RedisSock *redis_sock, int count, zval *z_ret
12741274

12751275
/* Iterate over each message */
12761276
for (i = 0; i < count; i++) {
1277-
/* Consume inner multi-bulk header, message ID itself and finaly
1277+
/* Consume inner multi-bulk header, message ID itself and finally
12781278
* the multi-bulk header for field and values */
12791279
if ((read_mbulk_header(redis_sock, &mhdr) < 0 || mhdr != 2) ||
12801280
((id = redis_sock_read(redis_sock, &idlen)) == NULL) ||

redis.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,7 @@ PHP_METHOD(Redis, multi)
23472347
REDIS_ENABLE_MODE(redis_sock, PIPELINE);
23482348
}
23492349
} else if (multi_value == MULTI) {
2350-
/* Don't want to do anything if we're alredy in MULTI mode */
2350+
/* Don't want to do anything if we're already in MULTI mode */
23512351
if (!IS_MULTI(redis_sock)) {
23522352
cmd_len = REDIS_SPPRINTF(&cmd, "MULTI", "");
23532353
if (IS_PIPELINE(redis_sock)) {
@@ -2513,7 +2513,7 @@ redis_response_enqueued(RedisSock *redis_sock)
25132513
}
25142514

25152515
/* TODO: Investigate/fix the odd logic going on in here. Looks like previous abort
2516-
* condidtions that are now simply empty if { } { } blocks. */
2516+
* conditions that are now simply empty if { } { } blocks. */
25172517
PHP_REDIS_API int
25182518
redis_sock_read_multibulk_multi_reply_loop(INTERNAL_FUNCTION_PARAMETERS,
25192519
RedisSock *redis_sock, zval *z_tab,
@@ -3042,7 +3042,7 @@ PHP_METHOD(Redis, script) {
30423042
RETURN_FALSE;
30433043
}
30443044

3045-
/* Free our alocated arguments */
3045+
/* Free our allocated arguments */
30463046
efree(z_args);
30473047

30483048
// Kick off our request
@@ -3496,7 +3496,7 @@ generic_scan_cmd(INTERNAL_FUNCTION_PARAMETERS, REDIS_SCAN_TYPE type) {
34963496

34973497
// The iterator should be passed in as NULL for the first iteration, but we
34983498
// can treat any NON LONG value as NULL for these purposes as we've
3499-
// seperated the variable anyway.
3499+
// separated the variable anyway.
35003500
if(Z_TYPE_P(z_iter) != IS_LONG || Z_LVAL_P(z_iter) < 0) {
35013501
/* Convert to long */
35023502
convert_to_long(z_iter);

redis_array_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ ra_find_name(const char *name) {
161161
return 0;
162162
}
163163

164-
/* laod array from INI settings */
164+
/* load array from INI settings */
165165
RedisArray *ra_load_array(const char *name) {
166166

167167
zval *z_data, z_fun, z_dist;

redis_cluster.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_kscan_cl, 0, 0, 2)
9090
ZEND_ARG_INFO(0, i_count)
9191
ZEND_END_ARG_INFO()
9292

93-
/* Argument infor for SCAN */
93+
/* Argument info for SCAN */
9494
ZEND_BEGIN_ARG_INFO_EX(arginfo_scan_cl, 0, 0, 2)
9595
ZEND_ARG_INFO(1, i_iterator)
9696
ZEND_ARG_INFO(0, str_node)
@@ -379,7 +379,7 @@ static void redis_cluster_init(redisCluster *c, HashTable *ht_seeds, double time
379379
c->read_timeout = read_timeout;
380380
c->persistent = persistent;
381381

382-
/* Calculate the number of miliseconds we will wait when bouncing around,
382+
/* Calculate the number of milliseconds we will wait when bouncing around,
383383
* (e.g. a node goes down), which is not the same as a standard timeout. */
384384
c->waitms = (long)(timeout * 1000);
385385

@@ -679,7 +679,7 @@ static HashTable *method_args_to_ht(zval *z_args, int argc) {
679679
return ht_ret;
680680
}
681681

682-
/* Convienience handler for commands that take multiple keys such as
682+
/* Convenience handler for commands that take multiple keys such as
683683
* MGET, DEL, and UNLINK */
684684
static int cluster_mkey_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len,
685685
zval *z_ret, cluster_cb cb)
@@ -2251,7 +2251,7 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg)
22512251
}
22522252
} else {
22532253
php_error_docref(0, E_WARNING,
2254-
"Direted commands musty be passed a key or [host,port] array");
2254+
"Directed commands must be passed a key or [host,port] array");
22552255
return -1;
22562256
}
22572257

@@ -2959,7 +2959,7 @@ PHP_METHOD(RedisCluster, ping) {
29592959
/* Send it off */
29602960
rtype = CLUSTER_IS_ATOMIC(c) && arg != NULL ? TYPE_BULK : TYPE_LINE;
29612961
if (cluster_send_slot(c, slot, cmd, cmdlen, rtype) < 0) {
2962-
CLUSTER_THROW_EXCEPTION("Unable to send commnad at the specificed node", 0);
2962+
CLUSTER_THROW_EXCEPTION("Unable to send command at the specified node", 0);
29632963
efree(cmd);
29642964
RETURN_FALSE;
29652965
}
@@ -3081,7 +3081,7 @@ PHP_METHOD(RedisCluster, echo) {
30813081
/* Send it off */
30823082
rtype = CLUSTER_IS_ATOMIC(c) ? TYPE_BULK : TYPE_LINE;
30833083
if (cluster_send_slot(c,slot,cmd,cmd_len,rtype) < 0) {
3084-
CLUSTER_THROW_EXCEPTION("Unable to send commnad at the specificed node", 0);
3084+
CLUSTER_THROW_EXCEPTION("Unable to send command at the specified node", 0);
30853085
efree(cmd);
30863086
RETURN_FALSE;
30873087
}

redis_commands.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,7 +2176,7 @@ int redis_smove_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
21762176
if (src_free) efree(src);
21772177
if (dst_free) efree(dst);
21782178

2179-
// Succcess!
2179+
// Success!
21802180
return SUCCESS;
21812181
}
21822182

@@ -3867,8 +3867,8 @@ int redis_xtrim_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
38673867

38683868
/*
38693869
* Redis commands that don't deal with the server at all. The RedisSock*
3870-
* pointer is the only thing retreived differently, so we just take that
3871-
* in additon to the standard INTERNAL_FUNCTION_PARAMETERS for arg parsing,
3870+
* pointer is the only thing retrieved differently, so we just take that
3871+
* in addition to the standard INTERNAL_FUNCTION_PARAMETERS for arg parsing,
38723872
* return value handling, and thread safety. */
38733873

38743874
void redis_getoption_handler(INTERNAL_FUNCTION_PARAMETERS,
@@ -4087,7 +4087,7 @@ void redis_unserialize_handler(INTERNAL_FUNCTION_PARAMETERS,
40874087
}
40884088
zval zv, *z_ret = &zv;
40894089
if (!redis_unserialize(redis_sock, value, value_len, z_ret)) {
4090-
// Badly formed input, throw an execption
4090+
// Badly formed input, throw an exception
40914091
zend_throw_exception(ex, "Invalid serialized data, or unserialization error", 0);
40924092
RETURN_FALSE;
40934093
}

0 commit comments

Comments
 (0)