{"id":23092654,"url":"https://github.com/kjdev/php-ext-vedis","last_synced_at":"2025-08-16T10:31:16.397Z","repository":{"id":11975997,"uuid":"14549473","full_name":"kjdev/php-ext-vedis","owner":"kjdev","description":"PHP Extension for Vedis","archived":false,"fork":false,"pushed_at":"2018-01-01T06:41:56.000Z","size":248,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-18T00:52:34.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"godbus/dbus","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kjdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-20T07:17:10.000Z","updated_at":"2022-09-10T03:33:37.000Z","dependencies_parsed_at":"2022-09-01T15:52:31.747Z","dependency_job_id":null,"html_url":"https://github.com/kjdev/php-ext-vedis","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fphp-ext-vedis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fphp-ext-vedis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fphp-ext-vedis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kjdev%2Fphp-ext-vedis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kjdev","download_url":"https://codeload.github.com/kjdev/php-ext-vedis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230029151,"owners_count":18161990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T21:35:36.361Z","updated_at":"2024-12-16T21:35:37.109Z","avatar_url":"https://github.com/kjdev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Extension for Vedis\n\nThis extension allows Vedis.\n\nDocumentation for Vedis can be found at [» http://vedis.symisc.net/](http://vedis.symisc.net/).\n\n## Build\n\n```\n% phpize\n% ./configure\n% make\n% make test\n% make install\n```\n\n## Configration\n\nvedis.ini:\n\n```\nextension=vedis.so\n```\n\n## Examples\n\n```\n$vedis = new Vedis;\n$vedis-\u003eset('key', 'value');\n$value = $vedis-\u003eget('key');\n```\n\n## Keys and Strings\n\n### Strings\n\n* [get](#get) - Get the value of a key\n* [set](#set) - Set the string value of a key\n* [setnx](#setnx) - Set the value of a key, only if the key does not exist\n* [incr, incrBy](#incr-incrby) - Increment the value of a key\n* [decr, decrBy](#decr-decrby) - Decrement the value of a key\n* [mGet](#mget) - Get the values of all the given keys\n* [mSet, mSetNX](#mset-msetnx) - Set multiple keys to multiple values\n* [getSet](#getset) - Set the string value of a key and return its old value\n* [append](#append) - Append a value to a key\n* [strlen](#strlen) - Get the length of the value stored in a key\n\n### Keys\n\n* [del, delete](#del-delete) - Delete a key\n* [exists](#exists) - Determine if a key exists\n* [rename](#rename) - Rename a key\n\n----\n### get\n\n_**Description**_: Get the value related to the specified key\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*String* or *NULL*: If key didn't exist, `NULL` is returned. Otherwise,\nthe value related to this key is returned.\n\n#### *Examples*\n\n```\n$vedis-\u003eget('key');\n```\n\n----\n### set\n\n_**Description**_: Set the string value in argument as value of the key.\n\n#### *Parameters*\n\n*key*\n*value*\n\n#### *Return value*\n\n*Bool* `TRUE` if the command is successful.\n\n#### *Examples*\n\n```\n$vedis-\u003eset('key', 'value');\n```\n\n----\n### setnx\n\n_**Description**_: Set the string value in argument as value of the key if the\nkey doesn't already exist in the database.\n\n#### *Parameters*\n\n*key*\n*value*\n\n#### *Return value*\n\n*Bool* `TRUE` in case of success, `FALSE` in case of failure.\n\n#### *Examples*\n\n```\n$vedis-\u003esetnx('key', 'value'); /* TRUE */\n$vedis-\u003esetnx('key', 'value'); /* FALSE */\n```\n\n----\n### del, delete\n\n_**Description**_: Remove specified keys.\n\n#### *Parameters*\n\n*keys*: key1, key2, ... , keyN: Any number of parameters, each a key.\n\n#### *Return value*\n\n*Long* Number of keys deleted.\n\n#### *Examples*\n\n```\n$vedis-\u003eset('key1', 'val1');\n$vedis-\u003eset('key2', 'val2');\n$vedis-\u003eset('key3', 'val3');\n$vedis-\u003eset('key4', 'val4');\n\n$vedis-\u003edelete('key1', 'key2'); /* return 2 */\n$vedis-\u003edelete('key4', 'key10'); /* return 1 */\n```\n\n----\n### exists\n\n_**Description**_: Verify if the specified key exists.\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*BOOL*: If the key exists, return `TRUE`, otherwise return `FALSE`.\n\n#### *Examples*\n\n```\n$vedis-\u003eset('key', 'value');\n$vedis-\u003eexists('key'); /* TRUE */\n$vedis-\u003eexists('NonExistingKey'); /* FALSE */\n```\n\n----\n### incr, incrBy\n\n_**Description**_: Increment the number stored at key by one. If the second\nargument is filled, it will be used as the integer value of the increment.\n\n#### *Parameters*\n\n*key*\n*value*: value that will be added to key (only for incrBy)\n\n#### *Return value*\n\n*INT* the new value\n\n#### *Examples*\n\n```\n$vedis-\u003eincr('key1'); /* key1 didn't exists, set to 0 before the increment */\n                      /* and now has the value 1  */\n\n$vedis-\u003eincr('key1'); /* 2 */\n$vedis-\u003eincr('key1'); /* 3 */\n$vedis-\u003eincr('key1'); /* 4 */\n$vedis-\u003eincrBy('key1', 10); /* 14 */\n```\n\n----\n### decr, decrBy\n\n_**Description**_: Decrement the number stored at key by one. If the second\nargument is filled, it will be used as the integer value of the decrement.\n\n#### *Parameters*\n\n*key*\n*value*: value that will be substracted to key (only for decrBy)\n\n#### *Return value*\n\n*INT* the new value\n\n#### *Examples*\n\n```\n$vedis-\u003edecr('key1'); /* key1 didn't exists, set to 0 before the increment */\n                      /* and now has the value -1  */\n\n$vedis-\u003edecr('key1'); /* -2 */\n$vedis-\u003edecr('key1'); /* -3 */\n$vedis-\u003edecrBy('key1', 10); /* -13 */\n```\n\n----\n### mGet\n\n_**Description**_: Get the values of all the specified keys. If one or more keys\ndont exist, the array will contain `NULL` at the position of the key.\n\n#### *Parameters*\n\n*Array*: Array containing the list of the keys\n\n#### *Return value*\n\n*Array*: Array containing the values related to keys in argument\n\n#### *Examples*\n\n```\n$vedis-\u003eset('key1', 'value1');\n$vedis-\u003eset('key2', 'value2');\n$vedis-\u003eset('key3', 'value3');\n$vedis-\u003emGet(array('key1', 'key2', 'key3')); /* array('value1', 'value2', 'value3'); */\n$vedis-\u003emGet(array('key0', 'key1', 'key5')); /* array(NULL, 'value2', NULL); */\n```\n\n----\n### mset, msetnx\n\n_**Description**_: Sets multiple key-value pairs in one atomic command. MSETNX\nonly returns TRUE if all the keys were set (see SETNX).\n\n#### *Parameters*\n\n*Pairs*: array(key =\u003e value, ...)\n\n#### *Return value*\n\n*Bool* `TRUE` in case of success, `FALSE` in case of failure.\n\n#### *Example*\n\n```\n$vedis-\u003emset(array('key0' =\u003e 'value0', 'key1' =\u003e 'value1')); /* TRUE */\n$vedis-\u003emsetnx(array('key0' =\u003e 'value10', 'key1' =\u003e 'value11')); /* FALSE */\n\nvar_dump($vedis-\u003eget('key0'));\nvar_dump($vedis-\u003eget('key1'));\n```\n\nOutput:\n\n```\nstring(6) \"value0\"\nstring(6) \"value1\"\n```\n\n----\n### getSet\n\n_**Description**_: Sets a value and returns the previous entry at that key.\n\n#### *Parameters*\n\n*key*: key\n\n*STRING*: value\n\n#### *Return value*\n\nA string, the previous value located at this key.\n\n#### *Example*\n\n```\n$vedis-\u003eset('x', '42');\n$vedis-\u003egetSet('x', 'lol'); /* 42, replaces x by 'lol' */\n$vedis-\u003eget('x'); /* lol */\n```\n\n----\n### rename\n\n_**Description**_: Renames a key.\n\n#### *Parameters*\n\n*STRING*: srckey, the key to rename.\n\n*STRING*: dstkey, the new name for the key.\n\n#### *Return value*\n\n*BOOL*: `TRUE` in case of success, `FALSE` in case of failure.\n\n#### *Example*\n\n```\n$vedis-\u003eset('x', '42');\n$vedis-\u003erename('x', 'y');\n$vedis-\u003eget('y'); /* 42 */\n$vedis-\u003eget('x'); /* NULL */\n```\n\n----\n### append\n\n_**Description**_: Append specified string to the string stored in specified\nkey.\n\n#### *Parameters*\n\n*key*\n*value*\n\n#### *Return value*\n\n*INTEGER*: Size of the value after the append\n\n#### *Example*\n\n```\n$vedis-\u003eset('key', 'value1');\n$vedis-\u003eappend('key', 'value2'); /* 12 */\n$vedis-\u003eget('key'); /* value1value2 */\n```\n\n----\n### strlen\n\n_**Description**_: Get the length of a string value.\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*INTEGER*\n\n#### *Example*\n\n```\n$vedis-\u003eset('key', 'value');\n$vedis-\u003estrlen('key'); /* 5 */\n```\n\n\n## Hashes\n\n* [hSet](#hset) - Set the string value of a hash field\n* [hSetNx](#hsetnx) - Set the value of a hash field, only if the field does not exist\n* [hGet](#hget) - Get the value of a hash field\n* [hLen](#hlen) - Get the number of fields in a hash\n* [hDel](#hdel) - Delete one or more hash fields\n* [hKeys](#hkeys) - Get all the fields in a hash\n* [hVals](#hvals) - Get all the values in a hash\n* [hGetAll](#hgetall) - Get all the fields and values in a hash\n* [hExists](#hexists) - Determine if a hash field exists\n* [hMSet](#hmset) - Set multiple hash fields to multiple values\n* [hMGet](#hmget) - Get the values of all the given hash fields\n\n----\n### hSet\n\n_**Description**_: Adds a value to the hash stored at key. If this value is\nalready in the hash, `FALSE` is returned.\n\n#### *Parameters*\n\n*key*\n*field*\n*value*\n\n#### *Return value*\n\n*BOOL* `TRUE` if the field was set, `FALSE` if it was already present.\n\n#### *Example*\n\n```\n$vedis-\u003ehSet('h', 'key1', 'hello'); /* 'key1' =\u003e 'hello' in the hash at \"h\" */\n$vedis-\u003ehGet('h', 'key1'); /* hello */\n\n$vedis-\u003ehSet('h', 'key1', 'plop'); /* value was replaced. */\n$vedis-\u003ehGet('h', 'key1'); /* returns \"plop\" */\n```\n\n----\n### hSetNx\n\n_**Description**_: Adds a value to the hash stored at key only if this field\nisn't already in the hash.\n\n#### *Return value*\n\n*BOOL* `TRUE` if the field was set, `FALSE` if it was already present.\n\n#### *Example*\n\n```\n$vedis-\u003ehSetNx('h', 'key1', 'hello'); /* TRUE, 'key1' =\u003e 'hello' in the hash at \"h\" */\n$vedis-\u003ehSetNx('h', 'key1', 'world'); /* FALSE, 'key1' =\u003e 'hello' in the hash at \"h\". No change since the field wasn't replaced. */\n```\n\n----\n### hGet\n\n_**Description**_: Gets a value from the hash stored at key. If the hash table\ndoesn't exist, or the key doesn't exist, `FALSE` is returned.\n\n#### *Parameters*\n\n*key*\n*field*\n\n#### *Return value*\n\n*STRING* The value, if the command executed successfully\n*BOOL* `FALSE` in case of failure\n\n#### *Examples*\n\n```\n$vedis-\u003ehGet('h', 'key');\n```\n\n----\n### hLen\n\n_**Description**_: Returns the length of a hash, in number of items\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*LONG* the number of items in a hash, `FALSE` if the key doesn't exist or isn't\na hash.\n\n#### *Example*\n\n```\n$vedis-\u003ehSet('h', 'key1', 'hello');\n$vedis-\u003ehSet('h', 'key2', 'plop');\n$vedis-\u003ehLen('h'); /* 2 */\n```\n\n----\n### hDel\n\n_**Description**_: Removes a value from the hash stored at key. If the hash\ntable doesn't exist, or the key doesn't exist, `FALSE` is returned.\n\n#### *Parameters*\n\n*key*\n*field*\n\n#### *Return value*\n\n*BOOL* `TRUE` in case of success, `FALSE` in case of failure\n\n#### *Examples*\n\n```\n$vedis-\u003ehset('h', 'key1', 'val1');\n\n$vedis-\u003ehdel('h', 'key1');\n```\n\n----\n### hKeys\n\n_**Description**_: Returns the keys in a hash, as an array of strings.\n\n#### *Parameters*\n\n*Key*: key\n\n#### *Return value*\n\nAn array of elements, the keys of the hash. This works like PHP's array_keys().\n\n#### *Example*\n\n```\n$vedis-\u003ehSet('h', 'a', 'x');\n$vedis-\u003ehSet('h', 'b', 'y');\n$vedis-\u003ehSet('h', 'c', 'z');\n$vedis-\u003ehSet('h', 'd', 't');\nvar_dump($vedis-\u003ehKeys('h'));\n```\n\nOutput:\n\n```\narray(4) {\n  [0]=\u003e\n  string(1) \"a\"\n  [1]=\u003e\n  string(1) \"b\"\n  [2]=\u003e\n  string(1) \"c\"\n  [3]=\u003e\n  string(1) \"d\"\n}\n```\n\n----\n### hVals\n\n_**Description**_: Returns the values in a hash, as an array of strings.\n\n#### *Parameters*\n\n*Key*: key\n\n#### *Return value*\n\nAn array of elements, the values of the hash. This works like PHP's\narray_values().\n\n#### *Example*\n\n```\n$vedis-\u003ehSet('h', 'a', 'x');\n$vedis-\u003ehSet('h', 'b', 'y');\n$vedis-\u003ehSet('h', 'c', 'z');\n$vedis-\u003ehSet('h', 'd', 't');\nvar_dump($vedis-\u003ehVals('h'));\n```\n\nOutput:\n\n```\narray(4) {\n  [0]=\u003e\n  string(1) \"x\"\n  [1]=\u003e\n  string(1) \"y\"\n  [2]=\u003e\n  string(1) \"z\"\n  [3]=\u003e\n  string(1) \"t\"\n}\n```\n\n----\n### hGetAll\n\n_**Description**_: Returns the whole hash, as an array of strings indexed by\nstrings.\n\n#### *Parameters*\n\n*Key*: key\n\n#### *Return value*\n\nAn array of elements, the contents of the hash.\n\n#### *Example*\n\n```\n$vedis-\u003ehSet('h', 'a', 'x');\n$vedis-\u003ehSet('h', 'b', 'y');\n$vedis-\u003ehSet('h', 'c', 'z');\n$vedis-\u003ehSet('h', 'd', 't');\nvar_dump($vedis-\u003ehGetAll('h'));\n```\n\nOutput:\n\n```\narray(4) {\n  [\"a\"]=\u003e\n  string(1) \"x\"\n  [\"b\"]=\u003e\n  string(1) \"y\"\n  [\"c\"]=\u003e\n  string(1) \"z\"\n  [\"d\"]=\u003e\n  string(1) \"t\"\n}\n```\n\n----\n## hExists\n\n_**Description**_: Verify if the specified member exists in a key.\n\n#### *Parameters*\n\n*key*\n*field*\n\n#### *Return value*\n\n*BOOL*: If the member exists in the hash table, return `TRUE`, otherwise return\n`FALSE`.\n\n#### *Examples*\n\n```\n$vedis-\u003ehSet('h', 'a', 'x');\n$vedis-\u003ehExists('h', 'a'); /* TRUE */\n$vedis-\u003ehExists('h', 'NonExistingKey'); /* FALSE */\n```\n\n----\n### hMSet\n\n_**Description**_: Fills in a whole hash. Non-string values are converted to\nstring, using the standard `(string)` cast. NULL values are stored as empty\nstrings.\n\n#### *Parameters*\n\n*key*\n*members*: key -\u003e value array\n\n#### *Return value*\n\n*BOOL*\n\n#### *Examples*\n\n```\n$vedis-\u003ehMset('user:1', array('name' =\u003e 'Joe', 'salary' =\u003e 2000));\n```\n\n----\n### hMGet\n\n_**Description**_: Retrieve the values associated to the specified fields in the\nhash.\n\n#### *Parameters*\n\n*key*\n*memberKeys* Array\n\n#### *Return value*\n\n*Array* An array of elements, the values of the specified fields in the hash,\nwith the hash keys as array keys.\n\n#### *Examples*\n\n```\n$vedis-\u003ehSet('h', 'field1', 'value1');\n$vedis-\u003ehSet('h', 'field2', 'value2');\n$vedis-\u003ehmGet('h', array('field1', 'field2')); /* array('field1' =\u003e 'value1', 'field2' =\u003e 'value2') */\n```\n\n\n## Lists\n\n* [lIndex, lGet](#lindex-lget) - Get an element from a list by its index\n* [lPop](#lpop) - Remove and get the first element in a list\n* [lPush](#lpush) - Prepend one or multiple values to a list\n* [lLen, lSize](#llen-lsize) - Get the length/size of a list\n\n---\n### lIndex, lGet\n\n_**Description**_: Return the specified element of the list stored at the\nspecified key.\n\n0 the first element, 1 the second ...\n-1 the last element, -2 the penultimate ...\n\nReturn `FALSE` in case of a bad index or a key that doesn't point to a list.\n\n#### *Parameters*\n\n*key*\n*index*\n\n#### *Return value*\n\n*String* the element at this index\n*NULL* if the key identifies a non-string data type, or no value corresponds to\nthis index in the list `Key`.\n\n#### *Example*\n\n```\n$vedis-\u003elPush('key1', 'A');\n$vedis-\u003elPush('key1', 'B');\n$vedis-\u003elPush('key1', 'C'); /* key1 =\u003e [ 'A', 'B', 'C' ] */\n$vedis-\u003elGet('key1', 0); /* A */\n$vedis-\u003elGet('key1', -1); /* C */\n$vedis-\u003elGet('key1', 10); /* NULL */\n```\n\n----\n### lPop\n\n_**Description**_: Return and remove the first element of the list.\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*STRING* if command executed successfully\n*BOOL* `FALSE` in case of failure (empty list)\n\n#### *Example*\n\n```\n$vedis-\u003elPush('key1', 'A');\n$vedis-\u003elPush('key1', 'B');\n$vedis-\u003elPush('key1', 'C'); /* key1 =\u003e [ 'A', 'B', 'C' ] */\n$vedis-\u003elPop('key1'); /* key1 =\u003e [ NULL, 'B', 'C' ] */\n```\n\n----\n### lPush\n\n_**Description**_: Adds the string value to the head (left) of the list. Creates\nthe list if the key didn't exist. If the key exists and is not a list, `FALSE`\nis returned.\n\n#### *Parameters*\n\n*key*\n*value* String, value to push in key\n\n#### *Return value*\n\n*LONG* The new length of the list in case of success, `FALSE` in case of Failure.\n\n#### *Examples*\n\n```\n$vedis-\u003elPush('key1', 'C'); /* 1 */\n$vedis-\u003elPush('key1', 'B'); /* 2 */\n$vedis-\u003elPush('key1', 'A'); /* 3 */\n/* key1 now points to the following list: [ 'A', 'B', 'C' ] */\n```\n\n----\n### lLen, lSize\n\n_**Description**_: Returns the size of a list identified by Key.\n\nIf the list didn't exist or is empty, the command returns 0. If the data type\nidentified by Key is not a list, the command return `FALSE`.\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*LONG* The size of the list identified by Key exists.\n*BOOL* `FALSE` if the data type identified by Key is not list\n\n#### *Example*\n\n```\n$vedis-\u003elPush('key1', 'A');\n$vedis-\u003elPush('key1', 'B');\n$vedis-\u003elPush('key1', 'C'); /* key1 =\u003e [ 'A', 'B', 'C' ] */\n$vedis-\u003elSize('key1');/* 3 */\n$vedis-\u003elPop('key1');\n$vedis-\u003elSize('key1');/* 2 */\n```\n\n\n## Sets\n\n* [sAdd](#sadd) - Add one or more members to a set\n* [sCard, sSize](#scard-ssize) - Get the number of members in a set\n* [sDiff](#sdiff) - Subtract multiple sets\n* [sInter](#sinter) - Intersect multiple sets\n* [sIsMember](#sismember) - Determine if a given value is a member of a set\n* [sMembers](#smembers) - Get all the members in a set\n* [sPop](#spop) - Remove and get the last element in a set\n* [sRem, sRemove](#srem-sremove) - Remove one or more members from a set\n* [sPeek](#speek) - Get the last element in a set\n* [sTop](#stop) - Get the first element in a set\n\n---\n### sAdd\n\n_**Description**_: Adds a value to the set value stored at key. If this value is\nalready in the set, `FALSE` is returned.\n\n#### *Parameters*\n\n*key*\n*value*\n\n#### *Return value*\n\n*LONG* the number of elements added to the set.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('key1' , 'member1'); /* 1, 'key1' =\u003e {'member1'} */\n$vedis-\u003esAdd('key1' , 'member2', 'member3'); /* 2, 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n$vedis-\u003esAdd('key1' , 'member2'); /* 1, 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n```\n\n----\n### sCard, sSize\n\n_**Description**_: Returns the cardinality of the set identified by key.\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*LONG* the cardinality of the set identified by key, 0 if the set doesn't exist.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('key1' , 'member1');\n$vedis-\u003esAdd('key1' , 'member2');\n$vedis-\u003esAdd('key1' , 'member3'); /* 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n$vedis-\u003esCard('key1'); /* 3 */\n$vedis-\u003esCard('keyX'); /* 0 */\n```\n\n----\n### sDiff\n\n_**Description**_: Performs the difference between N sets and returns it.\n\n#### *Parameters*\n\n*keys*: key1, key2, ... , keyN: Any number of keys corresponding to sets.\n\n#### *Return value*\n\n*Array of strings*: The difference of the first set will all the others.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('s0', '1');\n$vedis-\u003esAdd('s0', '2');\n$vedis-\u003esAdd('s0', '3');\n$vedis-\u003esAdd('s0', '4');\n\n$vedis-\u003esAdd('s1', '1');\n$vedis-\u003esAdd('s2', '3');\n\nvar_dump($vedis-\u003esDiff('s0', 's1', 's2'));\n```\n\nReturn value: all elements of s0 that are neither in s1 nor in s2.\n\n```\narray(2) {\n  [0]=\u003e\n  string(1) \"2\"\n  [1]=\u003e\n  string(1) \"4\"\n}\n```\n\n----\n### sInter\n\n_**Description**_: Returns the members of a set resulting from the intersection\nof all the sets held at the specified keys.\n\nIf just a single key is specified, then this command produces the members of\nthis set. If one of the keys is missing, `FALSE` is returned.\n\n#### *Parameters*\n\nkey1, key2, keyN: keys identifying the different sets on which we will apply the\nintersection.\n\n#### *Return value*\n\nArray, contain the result of the intersection between those keys. If the\nintersection beteen the different sets is empty, the return value will be empty\narray.\n\n#### *Examples*\n\n```\n$vedis-\u003esAdd('key1', 'val1');\n$vedis-\u003esAdd('key1', 'val2');\n$vedis-\u003esAdd('key1', 'val3');\n$vedis-\u003esAdd('key1', 'val4');\n\n$vedis-\u003esAdd('key2', 'val3');\n$vedis-\u003esAdd('key2', 'val4');\n\n$vedis-\u003esAdd('key3', 'val3');\n$vedis-\u003esAdd('key3', 'val4');\n\nvar_dump($vedis-\u003esInter('key1', 'key2', 'key3'));\n```\n\nOutput:\n\n```\narray(2) {\n  [0]=\u003e\n  string(4) \"val3\"\n  [1]=\u003e\n  string(4) \"val4\"\n}\n```\n\n----\n### sIsMember\n\n_**Description**_: Checks if `value` is a member of the set stored at the key\n`key`.\n\n#### *Parameters*\n\n*key*\n*value*\n\n#### *Return value*\n\n*BOOL* `TRUE` if `value` is a member of the set at key `key`, `FALSE` otherwise.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('key1' , 'member1');\n$vedis-\u003esAdd('key1' , 'member2');\n$vedis-\u003esAdd('key1' , 'member3'); /* 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n\n$vedis-\u003esIsMember('key1', 'member1'); /* TRUE */\n$vedis-\u003esIsMember('key1', 'memberX'); /* FALSE */\n```\n\n----\n### sMembers\n\n_**Description**_: Returns the contents of a set.\n\n#### *Parameters*\n\n*Key*: key\n\n#### *Return value*\n\nAn array of elements, the contents of the set.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('s', 'a');\n$vedis-\u003esAdd('s', 'b');\n$vedis-\u003esAdd('s', 'a');\n$vedis-\u003esAdd('s', 'c');\nvar_dump($vedis-\u003esMembers('s'));\n```\n\nOutput:\n\n```\narray(3) {\n  [0]=\u003e\n  string(1) \"a\"\n  [1]=\u003e\n  string(1) \"b\"\n  [2]=\u003e\n  string(1) \"c\"\n}\n```\n\n----\n### sPop\n\n_**Description**_: Removes and returns a random element from the set value at\nKey.\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*String* \"popped\" value\n*Bool* `FALSE` if set identified by key is empty or doesn't exist.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('key1' , 'member1');\n$vedis-\u003esAdd('key1' , 'member2');\n$vedis-\u003esAdd('key1' , 'member3'); /* 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n$vedis-\u003esPop('key1'); /* member3, 'key1' =\u003e {'member1', 'member2'} */\n$vedis-\u003esPop('key1'); /* member2, 'key1' =\u003e {'member1'} */\n```\n\n----\n### sRem, sRemove\n\n_**Description**_: Removes the specified member from the set value stored at key.\n\n#### *Parameters*\n\n*key*\n*member*\n\n#### *Return value*\n\n*LONG* The number of elements removed from the set.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('key1' , 'member1');\n$vedis-\u003esAdd('key1' , 'member2');\n$vedis-\u003esAdd('key1' , 'member3'); /* 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n$vedis-\u003esRem('key1', 'member2', 'member3'); /* 2. 'key1' =\u003e {'member1'} */\n```\n\n----\n### sPeek\n\n_**Description**_: Get the last element in a set\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*String* \"popped\" value\n*Bool* `FALSE` if set identified by key is empty or doesn't exist.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('key1' , 'member1');\n$vedis-\u003esAdd('key1' , 'member2');\n$vedis-\u003esAdd('key1' , 'member3'); /* 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n$vedis-\u003esPeek('key1'); /* member3, 'key1' =\u003e {'member1', 'member2'} */\n$vedis-\u003esPeek('key1'); /* member2, 'key1' =\u003e {'member1'} */\n```\n\n----\n### sTop\n\n_**Description**_: Get the first element in a set\n\n#### *Parameters*\n\n*key*\n\n#### *Return value*\n\n*String* \"popped\" value\n*Bool* `FALSE` if set identified by key is empty or doesn't exist.\n\n#### *Example*\n\n```\n$vedis-\u003esAdd('key1' , 'member1');\n$vedis-\u003esAdd('key1' , 'member2');\n$vedis-\u003esAdd('key1' , 'member3'); /* 'key1' =\u003e {'member1', 'member2', 'member3'}*/\n$vedis-\u003esTop('key1'); /* member3, 'key1' =\u003e {'member1', 'member2'} */\n$vedis-\u003esTop('key1'); /* member2, 'key1' =\u003e {'member1'} */\n```\n\n\n## Misc\n\n* [begin](#begin) - Start a write transaction\n* [commit](#commit) - Commit an active write transaction\n* [rollback](#rollback) - Rollback an active write transaction\n* [cmdList](#cmdlist) - List of installed vedis commands\n* [eval](#eval) - Execute one or more Vedis commands\n* [credits](#credits) - Expand the vedis signature and copyright notice\n\n----\n### begin\n\n_**Description**_: Start a write transaction\n\n#### *Return value*\n\n*Bool* `TRUE` if the command is successful.\n\n----\n### commit\n\n_**Description**_: Commit an active write transaction\n\n#### *Return value*\n\n*Bool* `TRUE` if the command is successful.\n\n----\n### rollback\n\n_**Description**_: Rollback an active write transaction\n\n#### *Return value*\n\n*Bool* `TRUE` if the command is successful.\n\n----\n### cmdList\n\n_**Description**_: List of installed vedis commands\n\n#### *Return value*\n\n*Array*: Array of installed vedis commands\n\n----\n### eval\n\n_**Description**_: Execute one or more Vedis commands\n\n#### *Parameters*\n\n*STRING*: command\n\n#### *Return value*\n\nExecution result of the command.\n\n#### *Example*\n\n```\n$vedis-\u003eeval('SET key value; GET key'); /* value */\n```\n\n----\n### credits\n\n_**Description**_: Expand the vedis signature and copyright notice\n\n#### *Return value*\n\n*String*: Expand the vedis signature and copyright notice\n\n\n## TODO\n\n* Serializer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjdev%2Fphp-ext-vedis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjdev%2Fphp-ext-vedis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjdev%2Fphp-ext-vedis/lists"}