php - redis 중국어 도움말 매 뉴 얼시스템 관련config_eval_evalSha_script...
Description
Get or Set the redis config keys.
REIDS 시스템 설정 KEYS 를 가 져 오 거나 설정 합 니 다.
Parameters
operation (string) either
GET
or SET
key string for SET
, glob-pattern for GET
. See http://redis.io/commands/config-get for examples. value optional string (only for SET
) Return value
Associative array for
GET
, key -> value bool for SET
Examples
$redis->config("GET", "*max-*-entries*");
$redis->config("SET", "dir", "/var/run/redis/dumps/");
eval
Description
Evaluate a LUA script serverside
서버 에서 LUA 스 크 립 트 실행
Parameters
script string. args array, optional. num_keys int, optional.
Return value
Mixed. What is returned depends on what the LUA script itself returns, which could be a scalar value (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in your LUA script. If there is an error executing the LUA script, the getLastError() function can tell you the message that came back from Redis (e.g. compile error).
이 함수 가 돌아 온 결 과 는 함수 가 전송 한 LUA 스 크 립 트 의 실행 결과 입 니 다.결 과 는 일반적인 데이터 형식 일 수도 있 고 하나의 배열 을 만 들 수도 있 으 며 배열 에 도 배열 을 끼 워 넣 을 수 있다.돌아 온 결과 가 무엇이든 LUA 스 크 립 트 가 어떻게 실행 되 느 냐 에 달 려 있 습 니 다.전송 한 LUA 스 크 립 트 에 오류 가 있 으 면 getLastError () 는 이 오류 에 대한 REDIS 의 구체 적 인 메 시 지 를 되 돌려 줍 니 다.
Examples
$redis->eval("return 1"); // Returns an integer: 1
$redis->eval("return {1,2,3}"); // Returns Array(1,2,3)
$redis->del('mylist');
$redis->rpush('mylist','a');
$redis->rpush('mylist','b');
$redis->rpush('mylist','c');
// Nested response: Array(1,2,3,Array('a','b','c'));
$redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}");
evalSha
Description
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. In order to run this command Redis will have to have already loaded the script, either by running it or via the SCRIPT LOAD command.
Parameters
script_sha string. The sha1 encoded hash of the script you want to run. args array, optional. Arguments to pass to the LUA script. num_keys int, optional. The number of arguments that should go into the KEYS array, vs. the ARGV array when Redis spins the script
Return value
Mixed. See EVAL
Examples
$script = 'return 1';
$sha = $redis->script('load', $script);
$redis->evalSha($sha); // Returns 1
script
Description
Execute the Redis SCRIPT command to perform various operations on the scripting subsystem.
Redis 스 크 립 트 명령 을 실행 하여 각종 작업 을 수행 합 니 다.
Usage
$redis->script('load', $script);
$redis->script('flush');
$redis->script('kill');
$redis->script('exists', $script1, [$script2, $script3, ...]);
Return value
getLastError
Description
The last error message (if any) returned from a SCRIPT call
마지막 오류 소식 을 얻다.
Parameters
none
Return Value
A string with the last returned script based error message, or NULL if there is no error
Examples
$redis->eval('this-is-not-lua');
$err = $redis->getLastError();
// "ERR Error compiling script (new function): user_script:1: '=' expected near '-'"
_prefix
Description
A utility method to prefix the value with the prefix setting for phpredis.
VALUE 접두사 추가
Parameters
value string. The value you wish to prefix
Return value
If a prefix is set up, the value now prefixed. If there is no prefix, the value will be returned unchanged.
Examples
$redis->setOpt(Redis::OPT_PREFIX, 'my-prefix:');
$redis->_prefix('my-value'); // Will return 'my-prefix:my-value'
_unserialize
Description
A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the value will be returned unchanged. If there is a serializer set up, and the data passed in is malformed, an exception will be thrown. This can be useful if phpredis is serializing values, and you return something from redis in a LUA script that is serialized.
역 직렬 화 함수, 직렬 화 된 SET 형식 데이터 에 사용 합 니 다.매개 변수 가 직렬 화 된 SET 가 아니라면 바로 돌아 갑 니 다.직렬 화 된 SET 이지 만 PHP - REDIS 직렬 화 된 형식 이 아니라면 함수 가 이상 을 던 집 니 다.
Parameters
value string. The value to be unserialized
Examples
$redis->setOpt(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
$redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3)
dump
Description
Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. The data that comes out of DUMP is a binary representation of the key as Redis stores it.
KEY 하 나 를 REIDS 에서 소각 합 니 다 (단, 이 소각 은 물리 적 의미 에서 소각 되 는 것 이 아 닙 니 다). 이 소 각 된 VALUE 는 RESTORE 함 수 를 사용 하여 복원 할 수 있 습 니 다.DUMP 에서 삭 제 된 VALUE 를 사용 하면 함 수 는 이 데이터 가 REIDS 에 있 는 바 이 너 리 메모리 주 소 를 되 돌려 줍 니 다.
Parameters
key string
Return value
The Redis encoded value of the key, or FALSE if the key doesn't exist
Examples
$redis->set('foo', 'bar');
$val = $redis->dump('foo'); // $val will be the Redis encoded key value
restore
Description
Restore a key from the result of a DUMP operation.
DUMP 함수 에서 삭 제 된 VALUE 를 새 KEY 로 복원 합 니 다.
Parameters
key string. The key name ttl integer. How long the key should live (if zero, no expire will be set on the key) value string (binary). The Redis encoded key value (from DUMP)
Examples
$redis->set('foo', 'bar');
$val = $redis->dump('foo');
$redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo'
migrate
Description
Migrates a key to a different Redis instance.
KEY 섬의 다른 REIDS 인 스 턴 스 를 이전 합 니 다.
Parameters
host string. The destination host port integer. The TCP port to connect to. key string. The key to migrate. destination-db integer. The target DB. timeout integer. The maximum amount of time given to this transfer.
Examples
$redis->migrate('backup', 6379, 'foo', 0, 3600);
time
Description
Return the current Redis server time.
현재 REDIS 서버 의 생존 시간 을 되 돌려 줍 니 다.
Parameters
(none)
Return value
If successfull, the time will come back as an associative array with element zero being the unix timestamp, and element one being microseconds.
Examples
$redis->time();
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Redis 해시에 대한 완벽한 가이드변경 가능하므로 필요에 따라 쉽게 변경하고 업데이트할 수 있습니다. Redis 해시는 구조가 평평하므로 JSON에서와 같이 여러 수준을 가질 수 없습니다. redis 해시의 명명 규칙은 hash:key 로 입력되므로...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.