|
Reference Methods Connection handling- Redis construct()
- boolean connect(string host, int port)
- string ping()
- void close()
Commands operating on string values- boolean set(string key, string value)
- string get(string key)
- boolean add(string key, string value)
- boolean incr(string key, int value = 1)
- boolean decr(string key, int value = 1)
- array getMultiple(array(key1, key2, ..., keyn)) new!
Commands operating on the key space- boolean exists(string key)
- int type(string key)
- array getKeys(string pattern)
- boolean delete(string key)
Commands operating on list objects- boolean lPush(string key, string value, int type = 0)
- string lPop(string key, int type = 0)
- int lSize(string key)
- boolean listTrim(string key, int start, int end)
- string lGet(string key, int index)
- array lGetRange(string key, int start, int end)
- boolean lRemove(string key, string value, int count = 0) new!
Commands operating on set objects- boolean sAdd(string key, string member)
- int sSize(string key)
- mixed sRemove(string key, string member)
- boolean sContains(string key, string member)
- array sGetMembers(string key)
Sorting- array getSort(string key [,order = 0, pattern = "*", start=0, end = 0]) new!
|
Redis::incr() method behaves strange when increment value is not given. It sets random value for key.
your method naming convention is a bit wonky, prefixing l for list commands, then listTrim ? Otherwise, thanks for the lib =]
Wilson, I couldn't call it ltrim because a ltrim function already comes included in the PHP core (http://es.php.net/ltrim). Anyway, if you have a look at the disclaimer, the method names may change in the future.
Alfonso
I tried to compile this for Centos but failed. I am not much comfortable with linux so I am still not able to figure out what was the problem. Following is text which I get on command 'make && make install'
/bin/sh /var/redis/phpredis/libtool --mode=compile gcc -I. -I/var/redis/phpredis -DPHP_ATOM_INC -I/var/redis/phpredis/include -I/var/redis/phpredis/main -I/var/redis/phpredis -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /var/redis/phpredis/redis.c -o redis.lo
In file included from /var/redis/phpredis/redis.c:26: /var/redis/phpredis/php_redis.h:93: redefinition of `tsrm_ls' /var/redis/phpredis/php_redis.h:93: `tsrm_ls' previously declared here /var/redis/phpredis/redis.c: In function `redis_sock_read': /var/redis/phpredis/redis.c:234: warning: function returns address of local variable /var/redis/phpredis/redis.c: In function `redis_sock_read_bulk_reply': /var/redis/phpredis/redis.c:257: warning: function returns address of local variable /var/redis/phpredis/php_redis.h:93: prior parameter's size depends on `tsrm_ls' /var/redis/phpredis/redis.c: At top level: /var/redis/phpredis/redis.c:264: redefinition of `tsrm_ls' /var/redis/phpredis/redis.c:263: `tsrm_ls' previously declared here /var/redis/phpredis/redis.c: In function `redis_sock_read_multibulk_reply': /var/redis/phpredis/redis.c:263: redeclaration of `tsrm_ls' /var/redis/phpredis/redis.c:264: `tsrm_ls' previously declared here /var/redis/phpredis/redis.c:291: too few arguments to function `redis_sock_read' /var/redis/phpredis/redis.c: In function `redis_sock_write': /var/redis/phpredis/php_redis.h:93: prior parameter's size depends on `tsrm_ls' /var/redis/phpredis/redis.c: In function `redis_get_exception_base': /var/redis/phpredis/redis.c:359: warning: return makes pointer from integer without a cast make: redis.lo? Error 1Please help me out on this so that I can use Redis
it seems the author doesn't work on this project
This code should be in pecl, so others can take over when the project is unmaintained.
checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... gawk ./configure: line 3371: syntax error near unexpected token `newline' ./configure: line 3371: `<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'
php5.3 + centos5.2
Linux srv 2.6.18-92.1.18.el5.028stab060.2PAE #1 SMP Tue Jan 13 12:31:30 MSK 2009 i686 i686 i386 GNU/Linux
hi, my re2c is re2c 0.13.5, got the same problem?
need higher gcc or not ?