{"id":21437895,"url":"https://github.com/josephscott/marmerine","last_synced_at":"2025-07-14T15:31:19.466Z","repository":{"id":44355559,"uuid":"442307777","full_name":"josephscott/marmerine","owner":"josephscott","description":"An alternate Memcached implementation","archived":false,"fork":false,"pushed_at":"2024-01-20T03:45:23.000Z","size":9358,"stargazers_count":3,"open_issues_count":7,"forks_count":1,"subscribers_count":4,"default_branch":"trunk","last_synced_at":"2024-04-20T18:42:54.955Z","etag":null,"topics":["memcached","memcached-server"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/josephscott.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-12-28T00:36:03.000Z","updated_at":"2024-04-20T18:42:54.956Z","dependencies_parsed_at":"2024-01-12T07:53:12.705Z","dependency_job_id":"99bfa6fb-03b6-4f44-9ee1-05747eea2f74","html_url":"https://github.com/josephscott/marmerine","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephscott%2Fmarmerine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephscott%2Fmarmerine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephscott%2Fmarmerine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephscott%2Fmarmerine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josephscott","download_url":"https://codeload.github.com/josephscott/marmerine/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225986080,"owners_count":17555557,"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":["memcached","memcached-server"],"created_at":"2024-11-23T00:30:10.099Z","updated_at":"2024-11-23T00:30:10.608Z","avatar_url":"https://github.com/josephscott.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Marmerine\n\nThis is an alternate Memcached implementation.\n\n```\ngit clone https://github.com/josephscott/marmerine.git\ncomposer install\nphp server.php start\n```\n\n## Storage Commands\n\n### `set`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `set \u003ckey\u003e \u003cflags\u003e \u003cexptime\u003e \u003clength\u003e [noreply]\\r\\n\u003cdata\u003e\\r\\n`\n- **Success Response:** `STORED\\r\\n`\n- **Error Response:** `CLIENT_ERROR [error]\\r\\nERROR\\r\\n`\n\n__Examples__\n```shell\n$ printf \"set thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n```\n\n```shell\n$ printf \"set thing 0 300 3\\r\\nabc123XYZ\\r\\n\" | nc localhost 11211\nCLIENT_ERROR bad data chunk\nERROR\n```\n\n__Description__\n\nThis will store the value of the given key, even if it already exists.\n\n### `add`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `add \u003ckey\u003e \u003cflags\u003e \u003cexptime\u003e \u003clength\u003e [noreply]\\r\\n\u003cdata\u003e\\r\\n`\n- **Success Response:** `STORED\\r\\n`\n- **Failure Response:** `NOT_STORED\\r\\n`\n- **Error Response:** `CLIENT_ERROR [error]\\r\\nERROR\\r\\n`\n\n__Examples__\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n```\n\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc123XYZ\\r\\n\" | nc localhost 11211\nCLIENT_ERROR bad data chunk\nERROR\n```\n\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nNOT_STORED\n```\n\n__Description__\n\nThis will store the value of the given key, only if it does not already exist.\n\n### `replace`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `replace \u003ckey\u003e \u003cflags\u003e \u003cexptime\u003e \u003clength\u003e [noreply]\\r\\n\u003cdata\u003e\\r\\n`\n- **Success Response:** `STORED\\r\\n`\n- **Error Response:** `NOT_STORED\\r\\n`\n\n__Examples__\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"replace thing 0 300 12\\r\\nabc-REPLACED\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"get thing\\r\\n\" | nc localhost 11211\nVALUE thing 0 12\nabc-REPLACED\nEND\n```\n\n```shell\n$ printf \"replace thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nNOT_STORED\n```\n\n__Description__\n\nThis will replace the value of the given key.\n\n### `append`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `append \u003ckey\u003e \u003cflags\u003e \u003cexptime\u003e \u003clength\u003e [noreply]\\r\\n\u003cdata\u003e\\r\\n`\n- **Success Response:** `STORED\\r\\n`\n- **Error Response:** `NOT_STORED\\r\\n`\n\n__Examples__\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"append thing 0 300 6\\r\\n-AFTER\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"get thing\\r\\n\" | nc localhost 11211\nVALUE thing 0 9\nabc-AFTER\nEND\n```\n\n```shell\n$ printf \"append thing 0 300 6\\r\\n-AFTER\\r\\n\" | nc localhost 11211\nNOT_STORED\n```\n\n__Description__\nThis will append a string to the value of an existing key.\n\n### `prepend`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `prepend \u003ckey\u003e \u003cflags\u003e \u003cexptime\u003e \u003clength\u003e [noreply]\\r\\n\u003cdata\u003e\\r\\n`\n- **Success Response:** `STORED\\r\\n`\n- **Error Response:** `NOT_STORED\\r\\n`\n\n__EXAMPLES__\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"prepend thing 0 300 7\\r\\nBEFORE-\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"get thing\\r\\n\" | nc localhost 11211\nVALUE thing 0 10\nBEFORE-abc\nEND\n```\n\n__Description__\nThis will prepend a string to the value of an existing key.\n\n### `cas`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `cas \u003ckey\u003e \u003cflags\u003e \u003cexpiry\u003e \u003cdatalen\u003e \u003ccas\u003e [noreply]\\r\\n\u003cdata\u003e\\r\\n`\n- **Success Response:** `STORED\\r\\n`\n- **Error Resposne:** `NOT_STORED\\r\\n`\n\n__EXAMPLES__\n```\n$ printf \"set thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"gets thing\\r\\n\" | nc localhost 11211\nVALUE thing 0 3 1\nabc\nEND\n$ printf \"cas thing 0 300 3 1\\r\\nXYZ\\r\\n\"| nc localhost 11211\nSTORED\n```\n\n__Description__\n\nSet a new value for a key if the cas token hasn't changed.\n\n### `touch`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `touch \u003ckey\u003e \u003cexpiry\u003e [noreply]\\r\\n`\n- **Success Response:** `TOUCHED\\r\\n`\n- **Error Resposne:** `NOT_FOUND\\r\\n`\n\n__Examples__\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"touch thing 1800\\r\\n\" | nc localhost 11211\nTOUCHED\n```\n\n__Description__\n\nUpdate the expiration time of an existing key.\n\n## Retrieve Commands \n\n### `get`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `get \u003ckey\u003e [key2 key3 ... keyn]\\r\\n`\n- **Found Response:** `VALUE \u003ckey\u003e \u003cflags\u003e \u003clength\u003e\\r\\n\u003cdata\u003e\\r\\nEND\\r\\n`\n- **Not Found Response:** `END\\r\\n`\n\n__Examples__\n```shell\n$ printf \"set thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"get thing\\r\\n\" | nc localhost 11211\nVALUE thing 0 3\nabc\nEND\n```\n\n```shell\n$ printf \"get thing\\r\\n\" | nc localhost 11211\nEND\n```\n\n```shell\n$ printf \"set thing1 0 300 4\\r\\n1abc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"set thing2 0 300 4\\r\\n2abc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"set thing3 0 300 4\\r\\n3abc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"get thing thing1 thing2 thing3\\r\\n\" | nc localhost 11211\nVALUE thing1 0 4\n1abc\nVALUE thing2 0 4\n2abc\nVALUE thing3 0 4\n3abc\nEND\n```\n\n__Description__\n\nGets the value for the given key.  When the key does not exist, a response with just `END\\r\\n` is given.  When multiple keys are provided, only ones that exist will be returned.\n\n### `gets`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `get \u003ckey\u003e [key2 key3 ... keyn]\\r\\n`\n- **Found Response:** `VALUE \u003ckey\u003e \u003cflags\u003e \u003clength\u003e \u003ccas\u003e\\r\\n\u003cdata\u003e\\r\\nEND\\r\\n`\n- **Not Found Response:** `END\\r\\n`\n\n__Examples__\n```shell\n$ printf \"set thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"gets thing\\r\\n\" | nc localhost 11211\nVALUE thing 0 3 1\nabc\nEND\n```\n\n```shell\n$ printf \"gets thing\\r\\n\" | nc localhost 11211\nEND\n```\n\n__Description__\n\nThis is the get command with the addition of the cas token in the response.\n\n### `gat`\n\n- **Supported:** No \u0026#9940;\n\n### `gats`\n\n- **Supported:** No \u0026#9940;\n\n## Delete Commands\n\n### `delete`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `delete \u003ckey\u003e [noreply]\\r\\n`\n- **Success Response:** `DELETED\\r\\n`\n- **Not Found Response:** `NOT_FOUND\\r\\n`\n\n__Examples__\n```shell\n$ printf \"set thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"delete thing\\r\\n\" | nc localhost 11211\nDELETED\n```\n\n```shell\n$ printf \"delete thing\\r\\n\" | nc localhost 11211\nNOT_FOUND\n```\n\n__Description__\n\nDelete the given key.  If the key does not exist then `NOT_FOUND` is returned.\n\n### `flush_all`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `flush_all [delay] [noreply]\\r\\n`\n- **Every Response:** `OK\\r\\n`\n\n__Examples__\n```shell\n$ printf \"flush_all\\r\\n\" | nc localhost 11211\nOK\n```\n\n```shell\n$ printf \"flush_all\\r\\n\" | nc localhost 11211\nOK\n$ printf \"flush_all\\r\\n\" | nc localhost 11211\nOK\n```\n\n__Description__\n\nDelete all of the stored keys.  There is no fail or error condition, it always returns `OK`.\n\n## Arithmetic Commands\n\n### `incr`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `incr \u003ckey\u003e \u003cvalue\u003e [noreply]\\r\\n`\n- **Success Response:** `\u003cincremented value\u003e\\r\\n`\n- **Error Response:** `CLIENT_ERROR cannot increment or decrement non-numeric value`\n\n__Examples__\n```shell\n$ printf \"add thing 0 300 1\\r\\n1\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"incr thing 1\\r\\n\" | nc localhost 11211\n2\n$ printf \"incr thing 1\\r\\n\" | nc localhost 11211\n3\n```\n\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"incr thing 1\\r\\n\" | nc localhost 11211\nCLIENT_ERROR cannot increment or decrement non-numeric value\n```\n\n__Description__\n\nThis only works on integer values.\n\n### `decr`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `decr \u003ckey\u003e \u003cvalue\u003e [noreply]\\r\\n`\n- **Success Response:** `\u003cdecremented value\u003e\\r\\n`\n- **Error Response:** `CLIENT_ERROR cannot increment or decrement non-numeric value`\n\n__Examples__\n```shell\n$ printf \"add thing 0 300 1\\r\\n9\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"decr thing 1\\r\\n\" | nc localhost 11211\n8\n$ printf \"decr thing 1\\r\\n\" | nc localhost 11211\n7\n```\n\n```shell\n$ printf \"add thing 0 300 3\\r\\nabc\\r\\n\" | nc localhost 11211\nSTORED\n$ printf \"decr thing 1\\r\\n\" | nc localhost 11211\nCLIENT_ERROR cannot increment or decrement non-numeric value\n```\n\n__Description__\n\nThis only works on integer values.\n\n## Miscellaneous Commands\n\n### `quit`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `quit\\r\\n`\n- **Every Response:** ( None )\n\n__Examples__\n```shell\n$ printf \"quit\\r\\n\" | nc localhost 11211\n```\n\n__Description__\n\nThis closes the connection to the server.  It does not return anything.\n\n### `version`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `version\\r\\n`\n- **Every Response:** `VERSION \u003cversion\u003e\\r\\n`\n\n__Examples__\n```shell\n$ printf \"version\\r\\n\" | nc localhost 11211\nVERSION 1.6.12\n```\n\n__Description__\n\nGet the version number from the server.\n\n### `verbosity`\n\n- **Supported:** No \u0026#9940;\n\n### `stats`\n\n- **Supported:** Yes \u0026#9989;\n- **Format:** `stats\\r\\n`\n- **Every Response:** `STAT \u003cstat\u003e \u003cvalue\u003e\\r\\nEND\\r\\n`\n\n__Example__\n```shell\n$ printf \"stats\\r\\n\" | nc localhost 11211\nSTAT pid 92458\nSTAT uptime 9\nSTAT time 1650595977\nEND\n```\n\n__Description__\n\nStats that are currently supported:\n\n- pid\n- uptime\n- time\n- total_connections\n- curr_items\n- cmd_\u003ccommand\u003e\n- \u003ccommand\u003e_hits\n- \u003ccommand\u003e_misses\n\n## Memcached Resources\n\n- [Memcached](https://github.com/memcached/memcached), the original.\n- [Memcached Protocol.txt](https://github.com/memcached/memcached/blob/master/doc/protocol.txt), general description of the protocols.\n- [Twemproxy](https://github.com/twitter/twemproxy), a proxy for Memcached and Redis from Twitter.\n- [Twemproxy Memcached Notes](https://github.com/twitter/twemproxy/blob/master/notes/memcache.md), helpful list of of supported Memcached comands in Twemproxy.\n- [MySQL Memcached TCP Text Protocol](https://docs.oracle.com/cd/E17952_01/mysql-5.6-en/ha-memcached-interfaces-protocol.html), commands outlined for the MySQL implementation.\n- [Memcached Cheat Sheet](https://lzone.de/cheat-sheet/memcached), a list of other Memcached resources and examples.\n- [libmemcached-awesome](https://github.com/awesomized/libmemcached), an updated version of the original [libmemcached](https://libmemcached.org/libMemcached.html).\n- [memc.rs](https://www.memc.rs/intro), Memcached clone written in Rust, compatible with the binary protocol.\n- [memtier_benchmark](https://github.com/RedisLabs/memtier_benchmark), a Memcached ( and Redis ) benchmarking tool.\n- [Expiration Times](https://www.php.net/manual/en/memcached.expiration.php), good description of how Memcached treats the expiration times.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephscott%2Fmarmerine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosephscott%2Fmarmerine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephscott%2Fmarmerine/lists"}