Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2015-10-01 07:39:01 +0300
committermichael-grunder <michael.grunder@gmail.com>2015-10-01 07:39:01 +0300
commitedd777a6b4202580975447abfc95870572795e36 (patch)
treef1177234dbfdabb0795c34c550fd823fff2b3b25 /redis_commands.h
parent05e38d590143d044f18c63c5a581c645abd9d4b1 (diff)
Initial support for geo commands
This commit adds initial support for the new GEO commands. Presently the more complicated GEORADIUS[BYMEMBER] command doesn't do much post-processing of the response, but will probably be modified in the future to return it in a more php friendly way.
Diffstat (limited to 'redis_commands.h')
-rw-r--r--redis_commands.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/redis_commands.h b/redis_commands.h
index d3950e92..2bcd8893 100644
--- a/redis_commands.h
+++ b/redis_commands.h
@@ -21,6 +21,21 @@ typedef struct subscribeContext {
zend_fcall_info_cache cb_cache;
} subscribeContext;
+/* Georadius sort type */
+typedef enum geoSortType {
+ SORT_NONE,
+ SORT_ASC,
+ SORT_DESC
+} geoSortType;
+
+/* GEORADIUS and GEORADIUSBYMEMBER options */
+/*typedef struct geoRadiusOpts = {
+ int withcoord;
+ int withdist;
+ int withhash;
+ geoSortType sort;
+};*/
+
/* Construct a raw command */
int redis_build_raw_cmd(zval **z_args, int argc, char **cmd, int *cmd_len TSRMLS_DC);
@@ -224,6 +239,15 @@ int redis_command_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
int redis_fmt_scan_cmd(char **cmd, REDIS_SCAN_TYPE type, char *key, int key_len,
long it, char *pat, int pat_len, long count);
+int redis_geodist_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
+ char **cmd, int *cmd_len, short *slot, void **ctx);
+
+int redis_georadius_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
+ char **cmd, int *cmd_len, short *slot, void **ctx);
+
+int redis_georadiusbymember_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
+ char **cmd, int *cmd_len, short *slot, void **ctx);
+
/* Commands that don't communicate with Redis at all (such as getOption,
* setOption, _prefix, _serialize, etc). These can be handled in one place
* with the method of grabbing our RedisSock* object in different ways