All Projects → websupport-sk → Pecl Memcache

websupport-sk / Pecl Memcache

Licence: other
PHP Extension - Memcache module with support of newer PHP 7.x and PHP 8.x

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Pecl Memcache

Wp Spider Cache
Your friendly neighborhood caching solution for WordPress
Stars: ✭ 133 (-57.23%)
Mutual labels:  memcache
memcache.php
Visibility for your memcache servers.
Stars: ✭ 54 (-82.64%)
Mutual labels:  memcache
cachegrand
cachegrand is an open-source fast, scalable and secure Key-Value store, also fully compatible with Redis protocol, designed from the ground up to take advantage of modern hardware vertical scalability, able to provide better performance and a larger cache at lower cost, without losing focus on distributed systems.
Stars: ✭ 87 (-72.03%)
Mutual labels:  memcache
Nds
A Go (golang) Google App Engine datastore package with strongly consistent caching.
Stars: ✭ 154 (-50.48%)
Mutual labels:  memcache
Hfish
安全、可靠、简单、免费的企业级蜜罐
Stars: ✭ 2,977 (+857.23%)
Mutual labels:  memcache
memcache.php
An APC-like stats/info page for your memcached servers.(unix socket support)
Stars: ✭ 20 (-93.57%)
Mutual labels:  memcache
Overlord
Overlord是哔哩哔哩基于Go语言编写的memcache和redis&cluster的代理及集群管理功能,致力于提供自动化高可用的缓存服务解决方案。
Stars: ✭ 1,884 (+505.79%)
Mutual labels:  memcache
memcached
Memcached Operator for Kubernetes
Stars: ✭ 18 (-94.21%)
Mutual labels:  memcache
rust-memcache
memcache client for rust
Stars: ✭ 106 (-65.92%)
Mutual labels:  memcache
go-elasticache
Thin abstraction over the Memcache client package gomemcache (https://github.com/bradfitz/gomemcache) allowing it to support AWS ElastiCache cluster nodes
Stars: ✭ 15 (-95.18%)
Mutual labels:  memcache
Memjs
A memcache client for node using the binary protocol and SASL authentication
Stars: ✭ 161 (-48.23%)
Mutual labels:  memcache
Ninja Mutex
Mutex implementation for PHP
Stars: ✭ 180 (-42.12%)
Mutual labels:  memcache
Cachalot
Caching rethought – cache a lot in a proper way.
Stars: ✭ 25 (-91.96%)
Mutual labels:  memcache
Go Cache
This project encapsulates multiple db servers, redis、ledis、memcache、file、memory、nosql、postgresql
Stars: ✭ 143 (-54.02%)
Mutual labels:  memcache
memcache
Node.js memcached client with the most efficient ASCII protocol parser
Stars: ✭ 26 (-91.64%)
Mutual labels:  memcache
Sanic session
Provides server-backed sessions for Sanic using Redis, Memcache and more.
Stars: ✭ 131 (-57.88%)
Mutual labels:  memcache
easy-extends
一个简单快速安装PHP扩展的程序--最简单的方法就是使用Linux
Stars: ✭ 78 (-74.92%)
Mutual labels:  memcache
ansible-roles
Library of Ansible plugins and roles for deploying various services.
Stars: ✭ 14 (-95.5%)
Mutual labels:  memcache
mdserver-web
Simple Linux Panel
Stars: ✭ 1,064 (+242.12%)
Mutual labels:  memcache
akaash-rest-api
Akaash: A restful API template built with PHP driven by flight micro-framework
Stars: ✭ 17 (-94.53%)
Mutual labels:  memcache

This is an official repository for pecl-memcache plugin since 2019.

This repository contains modified pecl-memcache plugin ported to PHP8, which was originally developed for the need of hosting company in Slovakia (Websupport.sk).

The latest release is 8.0 (released: 2020-12-06) with support for PHP 8.0.

Please use version 4.0.5.1 (released: 2020-12-19) for PHP 7.x from branch NON_BLOCKING_IO_php7.

See: https://github.com/websupport-sk/pecl-memcache/releases See also release on PECL: https://pecl.php.net/package/memcache

Feel free to use it and post patches.

Original README:

memcached module for PHP

This module requires zlib library, used for on-the-fly data (de)compression. Also, you'll need memcached to use it =)

The memcached website is here: http://www.danga.com/memcached/

You will probably need libevent to install memcached: You can download it here: http://www.monkey.org/~provos/libevent/

How to run tests:

  1. sh tests/memcache.sh
  2. TEST_PHP_EXECUTABLE=/usr/local/bin/php php -dextension=modules/memcache.so run-tests.php -d extension=modules/memcache.so

New API in 3.0

Version 3 introduces a new class "MemcachePool" which implements the new API, the old class "Memcache" is still retained (but is deprecated) with the same interface for backwards compatibility. Please note that you need a new memcached version to use the CAS, default value to increment/decrement, append and prepend, and binary protocol features.

New INI directives are available to allow control over protocol, redundancy and hash strategy selection. These are

# The binary protocol results in less traffic and is more efficient
# for the client and server to generate/parse

memcache.protocol = {ascii, binary}		# default ascii

# When enabled the client sends requests to N servers in parallel, resulting in
# a somewhat crude reduncancy or mirroring, suitable when used as a session 
# storage. 
#
# If data integrity is of greater importance a real replicating memcached 
# backend such as "repcached" (http://sourceforge.net/projects/repcached/) is 
# recommended

memcache.redundancy = <int>			# default 1
memcache.session_redundancy = <int>		# default 2

# Hash strategy and function selection. The consistent hashing strategy
# is now the default as it allows servers to be added and removed from
# the pool without resulting in all or most keys being re-mapped to 
# other server (ie. voiding the cache)

memcache.hash_strategy = {standard, consistent}	# default consistent
memcache.hash_function = {crc32, fnv}			# default crc32

# Compression is enabled by default, the threshold which control the minimum 
# string length which triggers compresssion can be changed as

memcache.compress_threshold = <int>		# default 20000

The directives are used by the MemcachePool constructor so you can instantiate several pools with different settings by using ini_set() creativly. For example

ini_set('memcache.protocol', 'binary');

$binarypool = new MemcachePool();
$binarypool->addServer(...)

ini_set('memcache.protocol', 'ascii');
ini_set('memcache.redundancy', '2');

$redundantpool = new MemcachePool();
$redundantpool->addServer(...)

ini_set('memcache.redundancy', '1');

The new interface looks like

class MemcachePool() { bool connect(string host, int tcp_port = 11211, int udp_port = 0, bool persistent = true, int weight = 1, int timeout = 1, int retry_interval = 15) bool addServer(string host, int tcp_port = 11211, int udp_port = 0, bool persistent = true, int weight = 1, int timeout = 1, int retry_interval = 15, bool status = true) bool setServerParams(string host, int tcp_port = 11211, int timeout = 1, int retry_interval = 15, bool status = true)

/**
 * Supports fetching flags and CAS values
 */
mixed get(mixed key, mixed &flags = null, mixed &cas = null)

/**
 * Supports multi-set, for example
 *  $memcache->set(array('key1' => 'val1', 'key2' => 'val1'), null, 0, 60)
 */
bool add(mixed key, mixed var = null, int flag = 0, int exptime = 0)
bool set(mixed key, mixed var = null, int flag = 0, int exptime = 0)
bool replace(mixed key, mixed var = null, int flag = 0, int exptime = 0)

/**
 * Compare-and-Swap, uses the CAS param from MemcachePool::get() 
 */
bool cas(mixed key, mixed var = null, int flag = 0, int exptime = 0, int cas = 0)

/**
 * Prepends/appends a value to an existing one
 */
bool append(mixed key, mixed var = null, int flag = 0, int exptime = 0)
bool prepend(mixed key, mixed var = null, int flag = 0, int exptime = 0)

/**
 * Supports multi-key operations, for example
 *  $memcache->delete(array('key1', 'key2'))
 */
bool delete(mixed key, int exptime = 0)

/**
 * Supports multi-key operations, for example
 *  $memcache->increment(array('key1', 'key2'), 1, 0, 0)
 *
 * The new defval (default value) and exptime (expiration time) are used
 * if the key doesn't already exist. They must be supplied (even if 0) for
 * this to be enabled.
 *
 * Returns an integer with the new value if key is a string
 * Returns an array of integers if the key is an array
 */
mixed increment(mixed key, int value = 1, int defval = 0, int exptime = 0)
mixed decrement(mixed key, int value = 1, int defval = 0, int exptime = 0)

/**
 * Assigns a pool-specific failure callback which will be called when 
 * a request fails. May be null in order to disable callbacks. The callback
 * receive arguments like
 *
 *  function mycallback($host, $tcp_port, $udp_port, $error, $errnum)
 *
 * Where $host and $error are strings or null, the other params are integers.
 */
bool setFailureCallback(function callback)

/**
 * Locates the server a given would be hashed to
 * 
 * Returns a string "hostname:port" on success
 * Returns false on failure such as invalid key
 */
string findServer(string key)

}

Maintainers: Herman J. Radtke III hradtke at php dot net

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].