Projects
home:rottame:vhosts-ng:php8-extensions
php8-memcached
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
php8-memcached.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon May 19 14:15:40 UTC 2025 - Angelo Grossini <angelo@intercom.it> + +- update to 3.3.0 + +------------------------------------------------------------------- Wed Aug 16 12:45:23 UTC 2023 - Angelo Grossini <rottame@intercom.it> - vhng versioning
View file
php8-memcached.spec
Changed
@@ -23,7 +23,7 @@ %define pkg_name memcached Name: %{php_name}-%{pkg_name} -Version: 3.2.0 +Version: 3.3.0 Release: 0 Summary: PHP MemcacheD client Extension License: PHP-3.01
View file
memcached-3.2.0.tgz/memcached-3.2.0/README.markdown
Deleted
@@ -1,52 +0,0 @@ -Build Status ------------- -!Build Status(https://travis-ci.org/php-memcached-dev/php-memcached.png)(https://travis-ci.org/php-memcached-dev/php-memcached) - -Description ------------ -This is the PECL memcached(https://pecl.php.net/package/memcached) extension, -using the libmemcached library to connect to memcached servers. - -memcached(https://memcached.org) is a high-performance, distributed memory -object caching system, generic in nature, but intended for use in speeding up -dynamic web applications by alleviating database load. - -Building --------- - - $ phpize - $ ./configure - $ make - $ make test - -Dependencies ------------- - -php-memcached 3.x: -* Supports PHP 7.0 - 8.1. -* Requires libmemcached 1.x or higher. -* Optionally supports igbinary 2.0 or higher. -* Optionally supports msgpack 2.0 or higher. - -php-memcached 2.x: -* Supports PHP 5.2 - 5.6. -* Requires libmemcached 0.44 or higher. -* Optionally supports igbinary 1.0 or higher. -* Optionally supports msgpack 0.5 or higher. - -libmemcached(http://libmemcached.org/libMemcached.html) or the new -libmemcached-awesome(https://github.com/awesomized/libmemcached) version -1.0.18 or higher is recommended for best performance and compatibility with -memcached servers. - -igbinary(https://github.com/igbinary/igbinary) is a faster and more compact -binary serializer for PHP data structures. When installing php-memcached from -source code, the igbinary module must be installed first so that php-memcached -can access its C header files. Load both modules in your `php.ini` at runtime -to begin using igbinary. - -msgpack(https://msgpack.org) is a faster and more compact data structure -representation that is interoperable with msgpack implementations for other -languages. When installing php-memcached from source code, the msgpack module -must be installed first so that php-memcached can access its C header files. -Load both modules in your `php.ini` at runtime to begin using msgpack.
View file
memcached-3.2.0.tgz/memcached-3.2.0/config.m4
Deleted
@@ -1,409 +0,0 @@ -dnl vim:se ts=2 sw=2 et: - -PHP_ARG_ENABLE(memcached, whether to enable memcached support, - --enable-memcached Enable memcached support) - -PHP_ARG_WITH(libmemcached-dir, for libmemcached, - --with-libmemcached-dir=DIR Set the path to libmemcached install prefix., yes) - -PHP_ARG_ENABLE(memcached-session, whether to enable memcached session handler support, - --enable-memcached-session Enable memcached session handler support, yes, no) - -PHP_ARG_ENABLE(memcached-igbinary, whether to enable memcached igbinary serializer support, - --enable-memcached-igbinary Enable memcached igbinary serializer support, no, no) - -PHP_ARG_ENABLE(memcached-json, whether to enable memcached json serializer support, - --enable-memcached-json Enable memcached json serializer support, no, no) - -PHP_ARG_ENABLE(memcached-msgpack, whether to enable memcached msgpack serializer support, - --enable-memcached-msgpack Enable memcached msgpack serializer support, no, no) - -PHP_ARG_ENABLE(memcached-sasl, whether to enable memcached sasl support, - --enable-memcached-sasl Enable memcached sasl support, yes, no) - -PHP_ARG_ENABLE(memcached-protocol, whether to enable memcached protocol support, - --enable-memcached-protocol Enable memcached protocol support, no, no) - -PHP_ARG_WITH(system-fastlz, whether to use system FastLZ library, - --with-system-fastlz Use system FastLZ library, no, no) - -if test -z "$PHP_ZLIB_DIR"; then -PHP_ARG_WITH(zlib-dir, for ZLIB, - --with-zlib-dir=DIR Set the path to ZLIB install prefix., no) -fi - -if test -z "$PHP_DEBUG"; then - AC_ARG_ENABLE(debug, - --enable-debug Compile with debugging symbols, - PHP_DEBUG=$enableval - , PHP_DEBUG=no - ) -fi - -if test "$PHP_MEMCACHED" != "no"; then - - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - if test "x$PKG_CONFIG" = "xno"; then - AC_MSG_RESULT(pkg-config not found) - AC_MSG_ERROR(Please reinstall the pkg-config distribution) - fi - - dnl # zlib - if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then - if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then - PHP_ZLIB_DIR="$PHP_ZLIB_DIR" - PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" - elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then - PHP_ZLIB_DIR="$PHP_ZLIB_DIR" - PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" - else - AC_MSG_ERROR(Can't find ZLIB headers under "$PHP_ZLIB_DIR") - fi - else - for i in /usr/local /usr/local/opt/zlib /usr; do - if test -f "$i/include/zlib/zlib.h"; then - PHP_ZLIB_DIR="$i" - PHP_ZLIB_INCDIR="$i/include/zlib" - elif test -f "$i/include/zlib.h"; then - PHP_ZLIB_DIR="$i" - PHP_ZLIB_INCDIR="$i/include" - fi - done - fi - - AC_MSG_CHECKING(for zlib location) - if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then - AC_MSG_RESULT($PHP_ZLIB_DIR) - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, MEMCACHED_SHARED_LIBADD) - PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) - else - AC_MSG_ERROR(memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located) - fi - - if test "$PHP_MEMCACHED_SESSION" != "no"; then - AC_MSG_CHECKING(for session includes) - session_inc_path="" - - if test -f "$abs_srcdir/include/php/ext/session/php_session.h"; then - session_inc_path="$abs_srcdir/include/php" - elif test -f "$abs_srcdir/ext/session/php_session.h"; then - session_inc_path="$abs_srcdir" - elif test -f "$phpincludedir/ext/session/php_session.h"; then - session_inc_path="$phpincludedir" - else - for i in php php4 php5 php6; do - if test -f "$prefix/include/$i/ext/session/php_session.h"; then - session_inc_path="$prefix/include/$i" - fi - done - fi - - if test "$session_inc_path" = ""; then - AC_MSG_ERROR(Cannot find php_session.h) - else - AC_MSG_RESULT($session_inc_path) - fi - fi - - if test "$PHP_MEMCACHED_JSON" != "no"; then - AC_MSG_CHECKING(for json includes) - json_inc_path="" - - if test -f "$abs_srcdir/include/php/ext/json/php_json.h"; then - json_inc_path="$abs_srcdir/include/php" - elif test -f "$abs_srcdir/ext/json/php_json.h"; then - json_inc_path="$abs_srcdir" - elif test -f "$phpincludedir/ext/json/php_json.h"; then - json_inc_path="$phpincludedir" - else - for i in php php4 php5 php6; do - if test -f "$prefix/include/$i/ext/json/php_json.h"; then - json_inc_path="$prefix/include/$i" - fi - done - fi - if test "$json_inc_path" = ""; then - AC_MSG_ERROR(Cannot find php_json.h) - else - AC_DEFINE(HAVE_JSON_API,1,Whether JSON API is available) - AC_MSG_RESULT($json_inc_path) - fi - fi - - if test "$PHP_MEMCACHED_IGBINARY" != "no"; then - AC_MSG_CHECKING(for igbinary includes) - igbinary_inc_path="" - - if test -f "$abs_srcdir/include/php/ext/igbinary/igbinary.h"; then - igbinary_inc_path="$abs_srcdir/include/php" - elif test -f "$abs_srcdir/ext/igbinary/igbinary.h"; then - igbinary_inc_path="$abs_srcdir" - elif test -f "$phpincludedir/ext/session/igbinary.h"; then - igbinary_inc_path="$phpincludedir" - elif test -f "$phpincludedir/ext/igbinary/igbinary.h"; then - igbinary_inc_path="$phpincludedir" - else - for i in php php4 php5 php6; do - if test -f "$prefix/include/$i/ext/igbinary/igbinary.h"; then - igbinary_inc_path="$prefix/include/$i" - fi - done - fi - - if test "$igbinary_inc_path" = ""; then - AC_MSG_ERROR(Cannot find igbinary.h) - else - AC_MSG_RESULT($igbinary_inc_path) - fi - fi - - if test "$PHP_MEMCACHED_MSGPACK" != "no"; then - AC_MSG_CHECKING(for msgpack includes) - msgpack_inc_path="" - - if test -f "$abs_srcdir/include/php/ext/msgpack/php_msgpack.h"; then - msgpack_inc_path="$abs_srcdir/include/php" - elif test -f "$abs_srcdir/ext/msgpack/php_msgpack.h"; then - msgpack_inc_path="$abs_srcdir" - elif test -f "$phpincludedir/ext/session/php_msgpack.h"; then - msgpack_inc_path="$phpincludedir" - elif test -f "$phpincludedir/ext/msgpack/php_msgpack.h"; then - msgpack_inc_path="$phpincludedir" - else - for i in php php4 php5 php6; do - if test -f "$prefix/include/$i/ext/msgpack/php_msgpack.h"; then - msgpack_inc_path="$prefix/include/$i" - fi - done - fi - - if test "$msgpack_inc_path" = ""; then - AC_MSG_ERROR(Cannot find php_msgpack.h) - else - AC_MSG_RESULT($msgpack_inc_path) - fi - fi - - AC_MSG_CHECKING(for memcached session support) - if test "$PHP_MEMCACHED_SESSION" != "no"; then - AC_MSG_RESULT(enabled) - AC_DEFINE(HAVE_MEMCACHED_SESSION,1,Whether memcache session handler is enabled) - SESSION_INCLUDES="-I$session_inc_path" - ifdef(PHP_ADD_EXTENSION_DEP, - - PHP_ADD_EXTENSION_DEP(memcached, session) - ) - else - SESSION_INCLUDES="" - AC_MSG_RESULT(disabled) - fi
View file
memcached-3.2.0.tgz/memcached-3.2.0/config.w32
Deleted
@@ -1,43 +0,0 @@ -// vim:ft=javascript - -ARG_ENABLE('memcached', 'libmemcached extension', 'no'); - -ARG_ENABLE('memcached-session', 'whether to enable memcached session handler support', 'no'); -ARG_ENABLE('memcached-igbinary', 'whether to enable memcached igbinary serializer support', 'no'); -ARG_ENABLE('memcached-json', 'whether to enable memcached json serializer support', 'no'); - -if (PHP_MEMCACHED == "yes") { - - if (!CHECK_LIB("memcached.lib;libmemcached.lib", "memcached", PHP_MEMCACHED)) { - ERROR("memcached: library 'memcached' not found"); - } - - if (!CHECK_HEADER_ADD_INCLUDE("libmemcached/memcached.h", "CFLAGS_MEMCACHED")) { - ERROR("memcached: header 'libmemcached/memcached.h' not found"); - } - - if (PHP_MEMCACHED_JSON != "no"){ - AC_DEFINE("HAVE_JSON_API",1); - } - - var memcached_extra_src = ""; - - if (PHP_MEMCACHED_SESSION != "no"){ - AC_DEFINE("HAVE_MEMCACHED_SESSION",1); - ADD_EXTENSION_DEP("memcached", "session", true) - memcached_extra_src += " php_memcached_session.c"; - } - - if (PHP_MEMCACHED_IGBINARY != "no"){ - AC_DEFINE("HAVE_MEMCACHED_IGBINARY",1); - ADD_EXTENSION_DEP("memcached", "igbinary", true); - if (!CHECK_HEADER_ADD_INCLUDE("igbinary.h", "CFLAGS_MEMCACHED")) { - ERROR("memcached: header 'igbinary.h' not found"); - } - } - - EXTENSION("memcached", "php_memcached.c php_libmemcached_compat.c g_fmt.c"+memcached_extra_src, null, " /DHAVE_SSIZE_T"); - ADD_SOURCES(configure_module_dirname+"\\fastlz", "fastlz.c", "memcached"); - AC_DEFINE("HAVE_MEMCACHED", 1, "memcached support"); - AC_DEFINE("MEMCACHED_EXPORTS", 1) -}
View file
memcached-3.2.0.tgz/memcached-3.2.0/memcached.ini
Deleted
@@ -1,163 +0,0 @@ -memcached -; Use session locking -; valid values: On, Off -; the default is On -;memcached.sess_locking = On - -; The minimum time, in milliseconds, to wait between session lock attempts. -; This value is double on each lock retry until memcached.sess_lock_wait_max -; is reached, after which any further retries will take sess_lock_wait_max seconds. -; Default is 150. -;memcached.sess_lock_wait_min = 150; - -; The maximum time, in milliseconds, to wait between session lock attempts. -; Default is 150. -;memcached.sess_lock_wait_max = 150; - -; The number of times to retry locking the session lock, not including the first attempt. -; Default is 5. -;memcached.sess_lock_retries = 5; - -; The time, in seconds, before a lock should release itself. -; Setting to 0 results in the default behaviour, which is to -; use PHP's max_execution_time. -;memcached.sess_lock_expire = 0; - -; memcached session key prefix -; valid values are strings less than 219 bytes long -; the default value is "memc.sess.key." -;memcached.sess_prefix = "memc.sess.key." - -; Whether or not to re-use the memcached connections corresponding to the value(s) -; of session.save_path after the execution of the script ends. -; Don't use this if certain settings (e.g. SASL settings, sess_binary_protocol) would -; be overridden between requests. -; Default is Off. -;memcached.sess_persistent = Off - -; memcached session consistent hash mode -; if set to On, consistent hashing (libketama) is used -; for session handling. -; When consistent hashing is used, one can add or remove cache -; node(s) without messing up too much with existing keys -; default is On -;memcached.sess_consistent_hash = On - -; memcached session consistent hash type -; if set to 'ketama', consistent hashing (libketama) is used -; for session handling (default for php-memcached 3.x) -; if set to 'ketama_weighted', weighted consistent hashing (libketama) is used -; for session handling (default for php-memcached 2.x) -;memcached.sess_consistent_hash_type = "ketama" - -; Allow failed memcached server to automatically be removed. -; Default is Off. (In previous versions, this setting was called memcached.sess_remove_failed) -;memcached.sess_remove_failed_servers = Off - -; Set this value to enable the server be removed after -; configured number of continuous times connection failure. -;memcached.sess_server_failure_limit = 0 - -; Write data to a number of additional memcached servers -; This is "poor man's HA" as libmemcached calls it. -; If this value is positive and sess_remove_failed_servers is enabled -; when a memcached server fails the session will continue to be available -; from a replica. However, if the failed memcache server -; becomes available again it will read the session from there -; which could have old data or no data at all -;memcached.sess_number_of_replicas = 0 - -; Use the memcached binary protocol for memcached sessions (Instead of the text protocol) -; libmemcached replicas work only if binary mode is enabled. -; However, certain proxies (such as twemproxy) will work only if the binary protocol is disabled. -; In older versions of php-memcached, this setting was Off and was called memcached.sess_binary. -; Default is On with libmemcached 1.0.18 or newer. -; Default is Off with older version. -;memcached.sess_binary_protocol = On - -; memcached session replica read randomize -;memcached.sess_randomize_replica_read = Off - -; memcached connect timeout value -; In non-blocking mode this changes the value of the timeout -; during socket connection in milliseconds. Specifying -1 means an infinite timeout. -;memcached.sess_connect_timeout = 1000 - -; Session SASL username -; Both username and password need to be set for SASL to be enabled -;memcached.sess_sasl_username = NULL - -; Session SASL password -;memcached.sess_sasl_password = NULL - -; Set the compression type -; valid values are: fastlz, zlib -; the default is fastlz -;memcached.compression_type = "fastlz" - -; Compression factor -; Store compressed value only if the compression -; factor (saving) exceeds the set limit. -; -; store compressed if: -; plain_len > comp_len * factor -; -; the default value is 1.3 (23% space saving) -;memcached.compression_factor = "1.3" - -; The compression threshold -; -; Do not compress serialized values below this threshold. -; the default is 2000 bytes -;memcached.compression_threshold = 2000 - -; Set the default serializer for new memcached objects. -; valid values are: php, igbinary, json, json_array, msgpack -; -; json - standard php JSON encoding. This serializer -; is fast and compact but only works on UTF-8 -; encoded data and does not fully implement -; serializing. See the JSON extension. -; json_array - as json, but decodes into arrays -; php - the standard php serializer -; igbinary - a binary serializer -; msgpack - a cross-language binary serializer -; -; The default is igbinary if available, then msgpack if available, then php otherwise. -;memcached.serializer = "igbinary" - -; The amount of retries for failed store commands. -; This mechanism allows transparent fail-over to secondary servers when -; set/increment/decrement/setMulti operations fail on the desired server in a multi-server -; environment. -; the default is 0 -;memcached.store_retry_count = 0 - -; Sets the default for consistent hashing for new connections. -; (To configure consistent hashing for session connections, -; use memcached.sess_consistent_hash instead) -; -; If set to On, consistent hashing (libketama) is used -; for session handling. -; When consistent hashing is used, one can add or remove cache -; node(s) without messing up too much with existing keys -; default is Off -;memcached.default_consistent_hash = Off - -; Sets the default memcached protocol for new connections. -; (To configure the memcached protocol for connections used by sessions, -; use memcached.sess_binary_protocol instead) -; -; If set to On, the memcached binary protocol is used by default. -; If set to Off, the memcached text protocol is used. -; Default is Off -;memcached.default_binary_protocol = Off - -; Sets the default memcached connection timeout for new connections. -; (To configure the memcached connection timeout for sessions, -; use memcached.sess_connect_timeout instead) -; In non-blocking mode this changes the value of the timeout. -; during socket connection in milliseconds. Specifying -1 means an infinite timeout. -; Specifying 0 means using the memcached library's default connection timeout. -; Default is 0. -;memcached.default_connect_timeout = 0
View file
memcached-3.2.0.tgz/memcached-3.2.0/php_memcached.c
Deleted
@@ -1,4368 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) 2009-2010 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andrei Zmievski <andrei@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* TODO - * - set LIBKETAMA_COMPATIBLE as the default? - * - fix unserialize(serialize($memc)) - */ - -#include "php_memcached.h" -#include "php_memcached_private.h" -#include "php_memcached_server.h" -#include "g_fmt.h" - -#include <ctype.h> -#include <limits.h> - -#ifdef HAVE_MEMCACHED_SESSION -# include "php_memcached_session.h" -#endif -#ifdef HAVE_FASTLZ_H -#include <fastlz.h> -#else -#include "fastlz/fastlz.h" -#endif -#include <zlib.h> - -#ifdef HAVE_JSON_API -# include "ext/json/php_json.h" -#endif - -#ifdef HAVE_MEMCACHED_IGBINARY -#ifdef PHP_WIN32 -//Windows extensions are generally built together, -//so it wont be in the installed location -#include "igbinary.h" -#else -# include "ext/igbinary/igbinary.h" -#endif -#endif - -#ifdef HAVE_MEMCACHED_MSGPACK -# include "ext/msgpack/php_msgpack.h" -#endif - -# include "ext/spl/spl_exceptions.h" - -static int le_memc; - -static int php_memc_list_entry(void) { - return le_memc; -} - -/**************************************** - Protocol parameters -****************************************/ -#define MEMC_OBJECT_KEY_MAX_LENGTH 250 - -/**************************************** - Custom options -****************************************/ -#define MEMC_OPT_COMPRESSION -1001 -#define MEMC_OPT_PREFIX_KEY -1002 -#define MEMC_OPT_SERIALIZER -1003 -#define MEMC_OPT_COMPRESSION_TYPE -1004 -#define MEMC_OPT_STORE_RETRY_COUNT -1005 -#define MEMC_OPT_USER_FLAGS -1006 - -/**************************************** - Custom result codes -****************************************/ -#define MEMC_RES_PAYLOAD_FAILURE -1001 - -/**************************************** - Payload value flags -****************************************/ -#define MEMC_CREATE_MASK(start, n_bits) (((1 << n_bits) - 1) << start) - -#define MEMC_MASK_TYPE MEMC_CREATE_MASK(0, 4) -#define MEMC_MASK_INTERNAL MEMC_CREATE_MASK(4, 12) -#define MEMC_MASK_USER MEMC_CREATE_MASK(16, 16) - -#define MEMC_VAL_GET_TYPE(flags) ((flags) & MEMC_MASK_TYPE) -#define MEMC_VAL_SET_TYPE(flags, type) ((flags) |= ((type) & MEMC_MASK_TYPE)) - -#define MEMC_VAL_IS_STRING 0 -#define MEMC_VAL_IS_LONG 1 -#define MEMC_VAL_IS_DOUBLE 2 -#define MEMC_VAL_IS_BOOL 3 -#define MEMC_VAL_IS_SERIALIZED 4 -#define MEMC_VAL_IS_IGBINARY 5 -#define MEMC_VAL_IS_JSON 6 -#define MEMC_VAL_IS_MSGPACK 7 - -#define MEMC_VAL_COMPRESSED (1<<0) -#define MEMC_VAL_COMPRESSION_ZLIB (1<<1) -#define MEMC_VAL_COMPRESSION_FASTLZ (1<<2) - -#define MEMC_VAL_GET_FLAGS(internal_flags) (((internal_flags) & MEMC_MASK_INTERNAL) >> 4) -#define MEMC_VAL_SET_FLAG(internal_flags, internal_flag) ((internal_flags) |= (((internal_flag) << 4) & MEMC_MASK_INTERNAL)) -#define MEMC_VAL_HAS_FLAG(internal_flags, internal_flag) ((MEMC_VAL_GET_FLAGS(internal_flags) & (internal_flag)) == (internal_flag)) -#define MEMC_VAL_DEL_FLAG(internal_flags, internal_flag) (internal_flags &= (~(((internal_flag) << 4) & MEMC_MASK_INTERNAL))) - -/**************************************** - User-defined flags -****************************************/ -#define MEMC_VAL_GET_USER_FLAGS(flags) ((flags & MEMC_MASK_USER) >> 16) -#define MEMC_VAL_SET_USER_FLAGS(flags, udf_flags) ((flags) |= ((udf_flags << 16) & MEMC_MASK_USER)) -#define MEMC_VAL_USER_FLAGS_MAX ((1 << 16) - 1) - -/**************************************** - "get" operation flags -****************************************/ -#define MEMC_GET_PRESERVE_ORDER 1 -#define MEMC_GET_EXTENDED 2 - -/**************************************** - Helper macros -****************************************/ -#define RETURN_FROM_GET RETURN_FALSE - -/**************************************** - Structures and definitions -****************************************/ - -typedef enum { - MEMC_OP_SET, - MEMC_OP_TOUCH, - MEMC_OP_ADD, - MEMC_OP_REPLACE, - MEMC_OP_APPEND, - MEMC_OP_PREPEND -} php_memc_write_op; - -typedef struct { - - zend_bool is_persistent; - zend_bool compression_enabled; - zend_bool encoding_enabled; - - zend_long serializer; - zend_long compression_type; - - zend_long store_retry_count; - zend_long set_udf_flags; - -#ifdef HAVE_MEMCACHED_SASL - zend_bool has_sasl_data; -#endif -} php_memc_user_data_t; - -typedef struct { - memcached_st *memc; - zend_bool is_pristine; - int rescode; - int memc_errno; - zend_object zo; -} php_memc_object_t; - -typedef struct { - size_t num_valid_keys; - - const char **mkeys; - size_t *mkeys_len; - - zend_string **strings; - -} php_memc_keys_t; - -typedef struct { - zval *object; - zend_fcall_info fci; - zend_fcall_info_cache fcc; -} php_memc_result_callback_ctx_t; - -static inline php_memc_object_t *php_memc_fetch_object(zend_object *obj) { - return (php_memc_object_t *)((char *)obj - XtOffsetOf(php_memc_object_t, zo)); -} -#define Z_MEMC_OBJ_P(zv) php_memc_fetch_object(Z_OBJ_P(zv)); - -#define MEMC_METHOD_INIT_VARS \ - zval* object = getThis(); \ - php_memc_object_t* intern = NULL; \ - php_memc_user_data_t* memc_user_data = NULL; - -#if PHP_VERSION_ID < 80000 -#define MEMC_METHOD_FETCH_OBJECT \
View file
memcached-3.2.0.tgz/memcached-3.2.0/php_memcached.h
Deleted
@@ -1,57 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) 2009 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andrei Zmievski <andrei@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_MEMCACHED_H -#define PHP_MEMCACHED_H - -#include "php.h" -#include "Zend/zend_smart_str.h" - -#ifdef PHP_WIN32 -#include "main/config.w32.h" -#else -#include "main/php_config.h" -#endif - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#define PHP_MEMCACHED_VERSION "3.2.0" - -#if defined(PHP_WIN32) && defined(MEMCACHED_EXPORTS) -#define PHP_MEMCACHED_API __declspec(dllexport) -#else -#define PHP_MEMCACHED_API PHPAPI -#endif - -PHP_MEMCACHED_API zend_class_entry *php_memc_get_ce(void); -PHP_MEMCACHED_API zend_class_entry *php_memc_get_exception(void); -PHP_MEMCACHED_API zend_class_entry *php_memc_get_exception_base(int root); - -extern zend_module_entry memcached_module_entry; -#define phpext_memcached_ptr &memcached_module_entry - -#endif /* PHP_MEMCACHED_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */
View file
memcached-3.2.0.tgz/memcached-3.2.0/php_memcached.stub.php
Deleted
@@ -1,95 +0,0 @@ -<?php - -/** - * @generate-function-entries - * @generate-legacy-arginfo - */ - - -class Memcached { - - public function __construct(?string $persistent_id=null, ?callable $callback=null, ?string $connection_str=null) {} - - public function getResultCode(): int {} - public function getResultMessage(): string {} - - public function get(string $key, ?callable $cache_cb=null, int $get_flags=0): mixed {} - public function getByKey(string $server_key, string $key, ?callable $cache_cb=null, int $get_flags=0): mixed {} - public function getMulti(array $keys, int $get_flags=0): false|array {} - public function getMultiByKey(string $server_key, array $keys, int $get_flags=0): false|array {} - public function getDelayed(array $keys, bool $with_cas=false, ?callable $value_cb=null): bool {} - public function getDelayedByKey(string $server_key, array $keys, bool $with_cas=false, ?callable $value_cb=null): bool {} - public function fetch(): false|array {} - public function fetchAll(): false|array {} - - public function set(string $key, mixed $value, int $expiration=0): bool {} - public function setByKey(string $server_key, string $key, mixed $value, int $expiration=0): bool {} - - public function touch(string $key, int $expiration=0): bool {} - public function touchByKey(string $server_key, string $key, int $expiration=0): bool {} - - public function setMulti(array $items, int $expiration=0): bool {} - public function setMultiByKey(string $server_key, array $items, int $expiration=0): bool {} - - public function cas(string $cas_token, string $key, mixed $value, int $expiration=0): bool {} - public function casByKey(string $cas_token, string $server_key, string $key, mixed $value, int $expiration=0): bool {} - public function add(string $key, mixed $value, int $expiration=0): bool {} - public function addByKey(string $server_key, string $key, mixed $value, int $expiration=0): bool {} - public function append(string $key, string $value): ?bool {} - public function appendByKey(string $server_key, string $key, string $value): ?bool {} - public function prepend(string $key, string $value): ?bool {} - public function prependByKey(string $server_key, string $key, string $value): ?bool {} - public function replace(string $key, mixed $value, int $expiration=0): bool {} - public function replaceByKey(string $server_key, string $key, mixed $value, int $expiration=0): bool {} - public function delete(string $key, int $time=0): bool {} - public function deleteMulti(array $keys, int $time=0): array {} - public function deleteByKey(string $server_key, string $key, int $time=0): bool {} - public function deleteMultiByKey(string $server_key, array $keys, int $time=0): array {} - - public function increment(string $key, int $offset=1, int $initial_value=0, int $expiry=0): false|int {} - public function decrement(string $key, int $offset=1, int $initial_value=0, int $expiry=0): false|int {} - public function incrementByKey(string $server_key, string $key, int $offset=1, int $initial_value=0, int $expiry=0): false|int {} - public function decrementByKey(string $server_key, string $key, int $offset=1, int $initial_value=0, int $expiry=0): false|int {} - - public function addServer(string $host, int $port, int $weight=0): bool {} - public function addServers(array $servers): bool {} - public function getServerList(): array {} - public function getServerByKey(string $server_key): false|array {} - public function resetServerList(): bool {} - public function quit(): bool {} - public function flushBuffers(): bool {} - - public function getLastErrorMessage(): string {} - public function getLastErrorCode(): int {} - public function getLastErrorErrno(): int {} - public function getLastDisconnectedServer(): false|array {} - - public function getStats(?string $type=null): false|array {} - public function getVersion(): false|array {} - public function getAllKeys(): false|array {} - - public function flush(int $delay=0): bool {} - - public function getOption(int $option): mixed {} - public function setOption(int $option, mixed $value): bool {} - public function setOptions(array $options): bool {} - public function setBucket(array $host_map, ?array $forward_map, int $replicas): bool {} -#ifdef HAVE_MEMCACHED_SASL - public function setSaslAuthData(string $username, string $password): bool {} -#endif - -#ifdef HAVE_MEMCACHED_SET_ENCODING_KEY - public function setEncodingKey(string $key): bool {} -#endif - public function isPersistent(): bool {} - public function isPristine(): bool {} - public function checkKey(string $key): bool {} -} - -#ifdef HAVE_MEMCACHED_PROTOCOL -class MemcachedServer { - - public function run(string $address): bool {} - public function on(int $event, callable $callback): bool {} -} -#endif
View file
memcached-3.2.0.tgz/memcached-3.2.0/php_memcached_arginfo.h
Deleted
@@ -1,417 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3f4694d4e1f3d1647a832acd8539b056b2ab5e7a */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, persistent_id, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, connection_str, IS_STRING, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getResultCode, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getResultMessage, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_get, 0, 1, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cache_cb, IS_CALLABLE, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getByKey, 0, 2, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cache_cb, IS_CALLABLE, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_getMulti, 0, 1, MAY_BE_FALSE|MAY_BE_ARRAY) - ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_getMultiByKey, 0, 2, MAY_BE_FALSE|MAY_BE_ARRAY) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getDelayed, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, with_cas, _IS_BOOL, 0, "false") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value_cb, IS_CALLABLE, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getDelayedByKey, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, with_cas, _IS_BOOL, 0, "false") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value_cb, IS_CALLABLE, 1, "null") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_fetch, 0, 0, MAY_BE_FALSE|MAY_BE_ARRAY) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_fetchAll arginfo_class_Memcached_fetch - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_set, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_setByKey, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_touch, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_touchByKey, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_setMulti, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, items, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_setMultiByKey, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, items, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_cas, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, cas_token, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_casByKey, 0, 4, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, cas_token, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_add arginfo_class_Memcached_set - -#define arginfo_class_Memcached_addByKey arginfo_class_Memcached_setByKey - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_append, 0, 2, _IS_BOOL, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_appendByKey, 0, 3, _IS_BOOL, 1) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_prepend arginfo_class_Memcached_append - -#define arginfo_class_Memcached_prependByKey arginfo_class_Memcached_appendByKey - -#define arginfo_class_Memcached_replace arginfo_class_Memcached_set - -#define arginfo_class_Memcached_replaceByKey arginfo_class_Memcached_setByKey - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_delete, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_deleteMulti, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_deleteByKey, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_deleteMultiByKey, 0, 2, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_increment, 0, 1, MAY_BE_FALSE|MAY_BE_LONG) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, initial_value, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiry, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_decrement arginfo_class_Memcached_increment - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_incrementByKey, 0, 2, MAY_BE_FALSE|MAY_BE_LONG) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, initial_value, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiry, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_decrementByKey arginfo_class_Memcached_incrementByKey - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_addServer, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, weight, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_addServers, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, servers, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getServerList, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_getServerByKey, 0, 1, MAY_BE_FALSE|MAY_BE_ARRAY) - ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_resetServerList, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_quit arginfo_class_Memcached_resetServerList - -#define arginfo_class_Memcached_flushBuffers arginfo_class_Memcached_resetServerList - -#define arginfo_class_Memcached_getLastErrorMessage arginfo_class_Memcached_getResultMessage - -#define arginfo_class_Memcached_getLastErrorCode arginfo_class_Memcached_getResultCode -
View file
memcached-3.2.0.tgz/memcached-3.2.0/php_memcached_legacy_arginfo.h
Deleted
@@ -1,413 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3f4694d4e1f3d1647a832acd8539b056b2ab5e7a */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached___construct, 0, 0, 0) - ZEND_ARG_INFO(0, persistent_id) - ZEND_ARG_INFO(0, callback) - ZEND_ARG_INFO(0, connection_str) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getResultCode, 0, 0, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_getResultMessage arginfo_class_Memcached_getResultCode - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_get, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, cache_cb) - ZEND_ARG_INFO(0, get_flags) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, cache_cb) - ZEND_ARG_INFO(0, get_flags) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getMulti, 0, 0, 1) - ZEND_ARG_INFO(0, keys) - ZEND_ARG_INFO(0, get_flags) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getMultiByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, keys) - ZEND_ARG_INFO(0, get_flags) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getDelayed, 0, 0, 1) - ZEND_ARG_INFO(0, keys) - ZEND_ARG_INFO(0, with_cas) - ZEND_ARG_INFO(0, value_cb) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getDelayedByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, keys) - ZEND_ARG_INFO(0, with_cas) - ZEND_ARG_INFO(0, value_cb) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_fetch arginfo_class_Memcached_getResultCode - -#define arginfo_class_Memcached_fetchAll arginfo_class_Memcached_getResultCode - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_set, 0, 0, 2) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_setByKey, 0, 0, 3) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_touch, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_touchByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_setMulti, 0, 0, 1) - ZEND_ARG_INFO(0, items) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_setMultiByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, items) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_cas, 0, 0, 3) - ZEND_ARG_INFO(0, cas_token) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_casByKey, 0, 0, 4) - ZEND_ARG_INFO(0, cas_token) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) - ZEND_ARG_INFO(0, expiration) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_add arginfo_class_Memcached_set - -#define arginfo_class_Memcached_addByKey arginfo_class_Memcached_setByKey - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_append, 0, 0, 2) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_appendByKey, 0, 0, 3) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_prepend arginfo_class_Memcached_append - -#define arginfo_class_Memcached_prependByKey arginfo_class_Memcached_appendByKey - -#define arginfo_class_Memcached_replace arginfo_class_Memcached_set - -#define arginfo_class_Memcached_replaceByKey arginfo_class_Memcached_setByKey - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_delete, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, time) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_deleteMulti, 0, 0, 1) - ZEND_ARG_INFO(0, keys) - ZEND_ARG_INFO(0, time) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_deleteByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, time) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_deleteMultiByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, keys) - ZEND_ARG_INFO(0, time) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_increment, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, initial_value) - ZEND_ARG_INFO(0, expiry) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_decrement arginfo_class_Memcached_increment - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_incrementByKey, 0, 0, 2) - ZEND_ARG_INFO(0, server_key) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, initial_value) - ZEND_ARG_INFO(0, expiry) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_decrementByKey arginfo_class_Memcached_incrementByKey - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_addServer, 0, 0, 2) - ZEND_ARG_INFO(0, host) - ZEND_ARG_INFO(0, port) - ZEND_ARG_INFO(0, weight) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_addServers, 0, 0, 1) - ZEND_ARG_INFO(0, servers) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_getServerList arginfo_class_Memcached_getResultCode - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getServerByKey, 0, 0, 1) - ZEND_ARG_INFO(0, server_key) -ZEND_END_ARG_INFO() - -#define arginfo_class_Memcached_resetServerList arginfo_class_Memcached_getResultCode - -#define arginfo_class_Memcached_quit arginfo_class_Memcached_getResultCode - -#define arginfo_class_Memcached_flushBuffers arginfo_class_Memcached_getResultCode - -#define arginfo_class_Memcached_getLastErrorMessage arginfo_class_Memcached_getResultCode - -#define arginfo_class_Memcached_getLastErrorCode arginfo_class_Memcached_getResultCode - -#define arginfo_class_Memcached_getLastErrorErrno arginfo_class_Memcached_getResultCode - -#define arginfo_class_Memcached_getLastDisconnectedServer arginfo_class_Memcached_getResultCode -
View file
memcached-3.2.0.tgz/memcached-3.2.0/php_memcached_private.h
Deleted
@@ -1,252 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) 2009 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andrei Zmievski <andrei@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_MEMCACHED_PRIVATE_H -#define PHP_MEMCACHED_PRIVATE_H - -#ifdef PHP_WIN32 -#include "main/config.w32.h" -#else -#include "main/php_config.h" -#endif - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php_libmemcached_compat.h" - -#include <stdlib.h> -#include <string.h> -#include <php.h> -#include <php_main.h> - -#ifdef ZTS -# include "TSRM.h" -#endif - -#include <php_ini.h> -#include <SAPI.h> -#include <ext/standard/info.h> -#include <zend_extensions.h> -#include <zend_exceptions.h> -#include <ext/standard/php_smart_string.h> -#include <ext/standard/php_var.h> -#include <ext/standard/basic_functions.h> - -#ifdef PHP_WIN32 - # if PHP_VERSION_ID >= 80000 - # include "php_stdint.h" -#else -# include "win32/php_stdint.h" -#endif -#else -/* Used to store the size of the block */ -# if defined(HAVE_INTTYPES_H) -# include <inttypes.h> -# elif defined(HAVE_STDINT_H) -# include <stdint.h> -# endif -#endif - -#ifndef HAVE_INT32_T -# if SIZEOF_INT == 4 -typedef int int32_t; -# elif SIZEOF_LONG == 4 -typedef long int int32_t; -# endif -#endif - -#ifndef HAVE_UINT32_T -# if SIZEOF_INT == 4 -typedef unsigned int uint32_t; -# elif SIZEOF_LONG == 4 -typedef unsigned long int uint32_t; -# endif -#endif - -/* Backwards compatibility for GC API change in PHP 7.3 */ -#if PHP_VERSION_ID < 70300 -# define GC_ADDREF(p) ++GC_REFCOUNT(p) -# define GC_DELREF(p) --GC_REFCOUNT(p) -# define GC_SET_REFCOUNT(p, rc) GC_REFCOUNT(p) = rc -#endif - -/**************************************** - Structures and definitions -****************************************/ -typedef enum { - SERIALIZER_PHP = 1, - SERIALIZER_IGBINARY = 2, - SERIALIZER_JSON = 3, - SERIALIZER_JSON_ARRAY = 4, - SERIALIZER_MSGPACK = 5 -} php_memc_serializer_type; - -typedef enum { - COMPRESSION_TYPE_ZLIB = 1, - COMPRESSION_TYPE_FASTLZ = 2 -} php_memc_compression_type; - -typedef struct { - const char *name; - php_memc_serializer_type type; -} php_memc_serializer; - -#if defined(HAVE_MEMCACHED_IGBINARY) -# define SERIALIZER_DEFAULT SERIALIZER_IGBINARY -# define SERIALIZER_DEFAULT_NAME "igbinary" -#elif defined(HAVE_MEMCACHED_MSGPACK) -# define SERIALIZER_DEFAULT SERIALIZER_MSGPACK -# define SERIALIZER_DEFAULT_NAME "msgpack" -#else -# define SERIALIZER_DEFAULT SERIALIZER_PHP -# define SERIALIZER_DEFAULT_NAME "php" -#endif /* HAVE_MEMCACHED_IGBINARY / HAVE_MEMCACHED_MSGPACK */ - -#ifdef HAVE_MEMCACHED_SASL -# include <sasl/sasl.h> -#endif - -#ifdef HAVE_MEMCACHED_PROTOCOL -typedef enum { - MEMC_SERVER_ON_MIN = -1, - MEMC_SERVER_ON_CONNECT = 0, - MEMC_SERVER_ON_ADD = 1, - MEMC_SERVER_ON_APPEND = 2, - MEMC_SERVER_ON_DECREMENT = 3, - MEMC_SERVER_ON_DELETE = 4, - MEMC_SERVER_ON_FLUSH = 5, - MEMC_SERVER_ON_GET = 6, - MEMC_SERVER_ON_INCREMENT = 7, - MEMC_SERVER_ON_NOOP = 8, - MEMC_SERVER_ON_PREPEND = 9, - MEMC_SERVER_ON_QUIT = 10, - MEMC_SERVER_ON_REPLACE = 11, - MEMC_SERVER_ON_SET = 12, - MEMC_SERVER_ON_STAT = 13, - MEMC_SERVER_ON_VERSION = 14, - MEMC_SERVER_ON_MAX -} php_memc_event_t; - - -typedef struct { - zend_fcall_info fci; - zend_fcall_info_cache fci_cache; -} php_memc_server_cb_t; -#endif - -ZEND_BEGIN_MODULE_GLOBALS(php_memcached) - -#ifdef HAVE_MEMCACHED_SESSION - /* Session related variables */ - struct { - zend_bool lock_enabled; - zend_long lock_wait_max; - zend_long lock_wait_min; - zend_long lock_retries; - zend_long lock_expiration; - - zend_bool binary_protocol_enabled; - zend_bool consistent_hash_enabled; - char *consistent_hash_name; - int consistent_hash_type; - - zend_long server_failure_limit; - zend_long number_of_replicas; - zend_bool randomize_replica_read_enabled; - zend_bool remove_failed_servers_enabled; - - zend_long connect_timeout; - - char *prefix; - zend_bool persistent_enabled; - - char *sasl_username; - char *sasl_password; - } session; -#endif - - struct { - char *serializer_name; - char *compression_name; - zend_long compression_threshold; - double compression_factor; - zend_long store_retry_count; - - /* Converted values*/ - php_memc_serializer_type serializer_type; - php_memc_compression_type compression_type; - - /* Whether we have initialised sasl for this process */ - zend_bool sasl_initialised; - - struct { - - zend_bool consistent_hash_enabled;
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/compression_conditions.phpt
Deleted
@@ -1,123 +0,0 @@ ---TEST-- -Memcached compression test ---SKIPIF-- -<?php if (!extension_loaded("memcached")) print "skip"; ?> ---FILE-- -<?php -include dirname (__FILE__) . '/config.inc'; -$m = memc_get_instance (); - -$short_data = "abcdefg"; -$data = file_get_contents(dirname(__FILE__) . '/testdata.res'); - -set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) { - echo "$errstr\n"; - return true; -}, E_WARNING); - -function get_compression($name) { - switch (strtolower($name)) { - case 'zlib': - return Memcached::COMPRESSION_ZLIB; - case 'fastlz': - return Memcached::COMPRESSION_FASTLZ; - default: - echo "Strange compression type: $name\n"; - return 0; - } -} - -function fetch_with_compression($m, $key, $value, $set_compression = '', $factor = 1.3, $threshold = 2000) { - ini_set("memcached.compression_factor", $factor); - ini_set("memcached.compression_threshold", $threshold); - - $len=strlen($value); - echo "len=$len set=$set_compression factor=$factor threshold=$threshold\n"; - - if (!$set_compression) { - $m->setOption(Memcached::OPT_COMPRESSION, false); - } else { - $m->setOption(Memcached::OPT_COMPRESSION, true); - $m->setOption(Memcached::OPT_COMPRESSION_TYPE, get_compression($set_compression)); - } - - $m->set($key, $value, 1800); - - $value_back = $m->get($key); - var_dump($value === $value_back); -} - -fetch_with_compression($m, 'hello01', $data, 'zlib', 1.3, 4); -fetch_with_compression($m, 'hello02', $data, 'fastlz', 1.3, 4); -fetch_with_compression($m, 'hello03', $data, '', 1.3, 4); -fetch_with_compression($m, 'hello04', $short_data, 'zlib', 1.3, 4); -fetch_with_compression($m, 'hello05', $short_data, 'fastlz', 1.3, 4); -fetch_with_compression($m, 'hello06', $short_data, '', 1.3, 4); -fetch_with_compression($m, 'hello11', $data, 'zlib', 0.3, 4); -fetch_with_compression($m, 'hello12', $data, 'fastlz', 0.3, 4); -fetch_with_compression($m, 'hello13', $data, '', 0.3, 4); -fetch_with_compression($m, 'hello14', $short_data, 'zlib', 0.3, 4); -fetch_with_compression($m, 'hello15', $short_data, 'fastlz', 0.3, 4); -fetch_with_compression($m, 'hello16', $short_data, '', 0.3, 4); -fetch_with_compression($m, 'hello21', $data, 'zlib', 1.3, 2000); -fetch_with_compression($m, 'hello22', $data, 'fastlz', 1.3, 2000); -fetch_with_compression($m, 'hello23', $data, '', 1.3, 2000); -fetch_with_compression($m, 'hello24', $short_data, 'zlib', 1.3, 2000); -fetch_with_compression($m, 'hello25', $short_data, 'fastlz', 1.3, 2000); -fetch_with_compression($m, 'hello26', $short_data, '', 1.3, 2000); -fetch_with_compression($m, 'hello31', $data, 'zlib', 0.3, 2000); -fetch_with_compression($m, 'hello32', $data, 'fastlz', 0.3, 2000); -fetch_with_compression($m, 'hello33', $data, '', 0.3, 2000); -fetch_with_compression($m, 'hello34', $short_data, 'zlib', 0.3, 2000); -fetch_with_compression($m, 'hello35', $short_data, 'fastlz', 0.3, 2000); -fetch_with_compression($m, 'hello36', $short_data, '', 0.3, 2000); -?> ---EXPECT-- -len=4877 set=zlib factor=1.3 threshold=4 -bool(true) -len=4877 set=fastlz factor=1.3 threshold=4 -bool(true) -len=4877 set= factor=1.3 threshold=4 -bool(true) -len=7 set=zlib factor=1.3 threshold=4 -bool(true) -len=7 set=fastlz factor=1.3 threshold=4 -bool(true) -len=7 set= factor=1.3 threshold=4 -bool(true) -len=4877 set=zlib factor=0.3 threshold=4 -bool(true) -len=4877 set=fastlz factor=0.3 threshold=4 -bool(true) -len=4877 set= factor=0.3 threshold=4 -bool(true) -len=7 set=zlib factor=0.3 threshold=4 -bool(true) -len=7 set=fastlz factor=0.3 threshold=4 -bool(true) -len=7 set= factor=0.3 threshold=4 -bool(true) -len=4877 set=zlib factor=1.3 threshold=2000 -bool(true) -len=4877 set=fastlz factor=1.3 threshold=2000 -bool(true) -len=4877 set= factor=1.3 threshold=2000 -bool(true) -len=7 set=zlib factor=1.3 threshold=2000 -bool(true) -len=7 set=fastlz factor=1.3 threshold=2000 -bool(true) -len=7 set= factor=1.3 threshold=2000 -bool(true) -len=4877 set=zlib factor=0.3 threshold=2000 -bool(true) -len=4877 set=fastlz factor=0.3 threshold=2000 -bool(true) -len=4877 set= factor=0.3 threshold=2000 -bool(true) -len=7 set=zlib factor=0.3 threshold=2000 -bool(true) -len=7 set=fastlz factor=0.3 threshold=2000 -bool(true) -len=7 set= factor=0.3 threshold=2000 -bool(true)
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/compression_types.phpt
Deleted
@@ -1,76 +0,0 @@ ---TEST-- -Memcached compression test ---SKIPIF-- -<?php include "skipif.inc";?> ---FILE-- -<?php -include dirname (__FILE__) . '/config.inc'; -$m = memc_get_instance (); - -$data = file_get_contents(dirname(__FILE__) . '/testdata.res'); - -function get_compression($name) { - switch (strtolower($name)) { - case 'zlib': - return Memcached::COMPRESSION_ZLIB; - case 'fastlz': - return Memcached::COMPRESSION_FASTLZ; - default: - echo "Strange compression type: $name\n"; - return 0; - } -} - -function fetch_with_compression($m, $key, $value, $set_compression = '', $get_compression = '') { - - echo "set=$set_compression get=$get_compression\n"; - - if (!$set_compression) { - $m->setOption(Memcached::OPT_COMPRESSION, false); - } else { - $m->setOption(Memcached::OPT_COMPRESSION, true); - $m->setOption(Memcached::OPT_COMPRESSION_TYPE, get_compression($set_compression)); - } - - $m->set($key, $value, 1800); - - if (!$get_compression) { - $m->setOption(Memcached::OPT_COMPRESSION, true); - } else { - $m->setOption(Memcached::OPT_COMPRESSION, true); - $m->setOption(Memcached::OPT_COMPRESSION_TYPE, get_compression($get_compression)); - } - - $value_back = $m->get($key); - var_dump($value === $value_back); -} - -fetch_with_compression($m, 'hello1', $data, 'zlib', 'zlib'); -fetch_with_compression($m, 'hello2', $data, 'zlib', 'fastlz'); -fetch_with_compression($m, 'hello3', $data, 'fastlz', 'fastlz'); -fetch_with_compression($m, 'hello4', $data, 'fastlz', 'zlib'); -fetch_with_compression($m, 'hello5', $data, '', 'zlib'); -fetch_with_compression($m, 'hello6', $data, '', 'fastlz'); -fetch_with_compression($m, 'hello7', $data, 'zlib', ''); -fetch_with_compression($m, 'hello8', $data, 'fastlz', ''); -fetch_with_compression($m, 'hello9', $data, '', ''); -?> ---EXPECT-- -set=zlib get=zlib -bool(true) -set=zlib get=fastlz -bool(true) -set=fastlz get=fastlz -bool(true) -set=fastlz get=zlib -bool(true) -set= get=zlib -bool(true) -set= get=fastlz -bool(true) -set=zlib get= -bool(true) -set=fastlz get= -bool(true) -set= get= -bool(true)
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/keys_ascii.phpt
Deleted
@@ -1,190 +0,0 @@ ---TEST-- -Test valid and invalid keys - ascii ---SKIPIF-- -<?php include "skipif.inc";?> ---FILE-- -<?php - -include dirname (__FILE__) . '/config.inc'; -$ascii = memc_get_instance (array ( - Memcached::OPT_BINARY_PROTOCOL => false, - Memcached::OPT_VERIFY_KEY => false - )); -// libmemcached can verify keys, but these are tests are for our own -// function s_memc_valid_key_ascii, so explicitly disable the checks -// that libmemcached can perform. - -echo 'ASCII: SPACES' . PHP_EOL; -var_dump ($ascii->set ('ascii key with spaces', 'this is a test')); -var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); - -echo 'ASCII: NEWLINE' . PHP_EOL; -var_dump ($ascii->set ('asciikeywithnewline' . PHP_EOL, 'this is a test')); -var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); - -echo 'ASCII: EMPTY' . PHP_EOL; -var_dump ($ascii->set (''/*empty key*/, 'this is a test')); -var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); - -echo 'ASCII: TOO LONG' . PHP_EOL; -var_dump ($ascii->set (str_repeat ('1234567890', 512), 'this is a test')); -var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); - -echo 'ASCII: GET' . PHP_EOL; -for ($i=0;$i<32;$i++) { - var_dump ($ascii->get ('asciikeywithnonprintablechar-' . chr($i) . '-here')); - var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); -} - -echo 'ASCII: SET' . PHP_EOL; -for ($i=0;$i<32;$i++) { - var_dump ($ascii->set ('asciikeywithnonprintablechar-' . chr($i) . '-here', 'this is a test')); - var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); -} - -echo 'OK' . PHP_EOL; - ---EXPECT-- -ASCII: SPACES -bool(false) -bool(true) -ASCII: NEWLINE -bool(false) -bool(true) -ASCII: EMPTY -bool(false) -bool(true) -ASCII: TOO LONG -bool(false) -bool(true) -ASCII: GET -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -ASCII: SET -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -OK
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/memcachedserver.phpt
Deleted
@@ -1,119 +0,0 @@ ---TEST-- -MemcachedServer ---SKIPIF-- -<?php -if (!extension_loaded("memcached")) { - die("skip memcached is not loaded\n"); -} -if (!class_exists("MemcachedServer")) { - die("skip memcached not built with libmemcachedprotocol support\n"); -} - -if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x1001000) { - die("skip needs at least libmemcached 1.1.0\n"); -} -?> ---FILE-- -<?php -include __DIR__ . '/server.inc'; -$server = memcached_server_start(); - -$cache = new Memcached(); -$cache->setOption(Memcached::OPT_BINARY_PROTOCOL, true); -$cache->setOption(Memcached::OPT_COMPRESSION, false); -$cache->addServer('127.0.0.1', 3434); - -$cache->add("add_key", "hello", 500); -$cache->append("append_key", "world"); -$cache->prepend("prepend_key", "world"); - -$cache->increment("incr", 2, 1, 500); -$cache->decrement("decr", 2, 1, 500); - -$cache->delete("delete_k"); -$cache->flush(1); - -var_dump($cache->get('get_this')); - -$cache->set ('set_key', 'value 1', 100); -$cache->replace ('replace_key', 'value 2', 200); - -var_dump($cache->getVersion()); -var_dump($cache->getStats()); -var_dump($cache->getStats("empty")); -var_dump($cache->getStats("foobar")); -var_dump($cache->getStats("scalar")); -var_dump($cache->getStats("numeric array")); - -$cache->quit(); -usleep(50000); - -memcached_server_stop($server); -?> -Done ---EXPECTF-- -Listening on 127.0.0.1:3434 -Incoming connection from 127.0.0.1:%s -Incoming connection from 127.0.0.1:%s -client_id=%s: Add key=add_key, value=hello, flags=0, expiration=500 -client_id=%s: Append key=append_key, value=world, cas=0 -client_id=%s: Prepend key=prepend_key, value=world, cas=0 -client_id=%s: Incrementing key=incr, delta=2, initial=1, expiration=500 -client_id=%s: Decrementing key=decr, delta=2, initial=1, expiration=500 -client_id=%s: Delete key=delete_k, cas=0 -client_id=%s: Flush when=1 -client_id=%s: Get key=get_this -client_id=%s: Noop -string(20) "Hello to you client!" -client_id=%s: Set key=set_key, value=value 1, flags=0, expiration=100, cas=0 -client_id=%s: Replace key=replace_key, value=value 2, flags=0, expiration=200, cas=0 -client_id=%s: Version -array(1) { - "127.0.0.1:3434"=> - string(5) "1.1.1" -} -client_id=%s: Stat key= -array(1) { - "127.0.0.1:3434"=> - array(2) { - "key"=> - string(0) "" - "foo"=> - string(3) "bar" - } -} -client_id=%s: Stat key=empty -array(0) { -} -client_id=%s: Stat key=foobar -array(1) { - "127.0.0.1:3434"=> - array(2) { - "key"=> - string(6) "foobar" - "foo"=> - string(3) "bar" - } -} -client_id=%s: Stat key=scalar -array(1) { - "127.0.0.1:3434"=> - array(1) { - 0=> - string(%d) "you want it, you get it" - } -} -client_id=%s: Stat key=numeric array -array(1) { - "127.0.0.1:3434"=> - array(3) { - -1=> - string(3) "one" - 0=> - string(3) "two" - 1=> - string(5) "three" - } -} -client_id=%s: Client quit -Done
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/memcachedserver6.phpt
Deleted
@@ -1,115 +0,0 @@ ---TEST-- -MemcachedServer ---SKIPIF-- -<?php -if (!extension_loaded("memcached")) { - die("skip memcached is not loaded\n"); -} -if (!class_exists("MemcachedServer")) { - die("skip memcached not built with libmemcachedprotocol support\n"); -} -?> ---FILE-- -<?php -include __DIR__ . '/server.inc'; -$server = memcached_server_start('server.php', '::1', 3434); - -$cache = new Memcached(); -$cache->setOption(Memcached::OPT_BINARY_PROTOCOL, true); -$cache->setOption(Memcached::OPT_COMPRESSION, false); -$cache->addServer('::1', 3434); - -$cache->add("add_key", "hello", 500); -$cache->append("append_key", "world"); -$cache->prepend("prepend_key", "world"); - -$cache->increment("incr", 2, 1, 500); -$cache->decrement("decr", 2, 1, 500); - -$cache->delete("delete_k"); -$cache->flush(1); - -var_dump($cache->get('get_this')); - -$cache->set ('set_key', 'value 1', 100); -$cache->replace ('replace_key', 'value 2', 200); - -var_dump($cache->getVersion()); -var_dump($cache->getStats()); -var_dump($cache->getStats("empty")); -var_dump($cache->getStats("foobar")); -var_dump($cache->getStats("scalar")); -var_dump($cache->getStats("numeric array")); - -$cache->quit(); -usleep(50000); - -memcached_server_stop($server); -?> -Done ---EXPECTF-- -Listening on ::1:3434 -Incoming connection from ::1:%s -Incoming connection from ::1:%s -client_id=%s: Add key=add_key, value=hello, flags=0, expiration=500 -client_id=%s: Append key=append_key, value=world, cas=0 -client_id=%s: Prepend key=prepend_key, value=world, cas=0 -client_id=%s: Incrementing key=incr, delta=2, initial=1, expiration=500 -client_id=%s: Decrementing key=decr, delta=2, initial=1, expiration=500 -client_id=%s: Delete key=delete_k, cas=0 -client_id=%s: Flush when=1 -client_id=%s: Get key=get_this -client_id=%s: Noop -string(20) "Hello to you client!" -client_id=%s: Set key=set_key, value=value 1, flags=0, expiration=100, cas=0 -client_id=%s: Replace key=replace_key, value=value 2, flags=0, expiration=200, cas=0 -client_id=%s: Version -array(1) { - "::1:3434"=> - string(5) "1.1.1" -} -client_id=%s: Stat key= -array(1) { - "::1:3434"=> - array(2) { - "key"=> - string(0) "" - "foo"=> - string(3) "bar" - } -} -client_id=%s: Stat key=empty -array(0) { -} -client_id=%s: Stat key=foobar -array(1) { - "::1:3434"=> - array(2) { - "key"=> - string(6) "foobar" - "foo"=> - string(3) "bar" - } -} -client_id=%s: Stat key=scalar -array(1) { - "::1:3434"=> - array(1) { - 0=> - string(%d) "you want it, you get it" - } -} -client_id=%s: Stat key=numeric array -array(1) { - "::1:3434"=> - array(3) { - -1=> - string(3) "one" - 0=> - string(3) "two" - 1=> - string(5) "three" - } -} -client_id=%s: Client quit -Done
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/options.phpt
Deleted
@@ -1,43 +0,0 @@ ---TEST-- -Memcached options ---SKIPIF-- -<?php include "skipif.inc";?> ---FILE-- -<?php -$m = new Memcached(); -$m->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_PHP); - -var_dump($m->getOption(Memcached::OPT_COMPRESSION)); -var_dump($m->getOption(Memcached::OPT_SERIALIZER)); -var_dump($m->getOption(Memcached::OPT_SOCKET_SEND_SIZE)); - -$m->setOption(Memcached::OPT_PREFIX_KEY, "\x01"); - -var_dump($m->getOption(Memcached::OPT_HASH) == Memcached::HASH_DEFAULT); -$m->setOption(Memcached::OPT_HASH, Memcached::HASH_MURMUR); -var_dump($m->getOption(Memcached::OPT_HASH) == Memcached::HASH_MURMUR); - - -$m->setOption(Memcached::OPT_COMPRESSION_TYPE, Memcached::COMPRESSION_ZLIB); -var_dump($m->getOption(Memcached::OPT_COMPRESSION_TYPE) == Memcached::COMPRESSION_ZLIB); - -$m->setOption(Memcached::OPT_COMPRESSION_TYPE, Memcached::COMPRESSION_FASTLZ); -var_dump($m->getOption(Memcached::OPT_COMPRESSION_TYPE) == Memcached::COMPRESSION_FASTLZ); - -var_dump($m->setOption(Memcached::OPT_COMPRESSION_TYPE, 0)); -var_dump($m->getOption(Memcached::OPT_COMPRESSION_TYPE) == Memcached::COMPRESSION_FASTLZ); -?> ---EXPECTF-- -bool(true) -int(1) - -Warning: Memcached::getOption(): no servers defined in %s on line %d -NULL - -Warning: Memcached::setOption(): bad key provided in %s on line %d -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(true)
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/set_large.phpt
Deleted
@@ -1,17 +0,0 @@ ---TEST-- -set large data ---SKIPIF-- -<?php include "skipif.inc";?> ---FILE-- -<?php -include dirname (__FILE__) . '/config.inc'; -$m = memc_get_instance (); - -$key = 'foobarbazDEADC0DE'; -$value = str_repeat("foo bar", 1024 * 1024); -var_dump($m->set($key, $value, 360)); -var_dump($m->get($key) === $value); -?> ---EXPECT-- -bool(true) -bool(true)
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/setoptions.phpt
Deleted
@@ -1,45 +0,0 @@ ---TEST-- -Set options using setOptions ---SKIPIF-- -<?php include "skipif.inc";?> ---FILE-- -<?php -$m = new Memcached(); - -/* existing options */ -var_dump($m->setOptions(array( - Memcached::OPT_PREFIX_KEY => 'a_prefix', - Memcached::OPT_SERIALIZER => Memcached::SERIALIZER_PHP, - Memcached::OPT_COMPRESSION => 0, - Memcached::OPT_LIBKETAMA_COMPATIBLE => 1, - Memcached::OPT_CONNECT_TIMEOUT => 5000, -))); - -var_dump($m->getOption(Memcached::OPT_PREFIX_KEY) == 'a_prefix'); -var_dump($m->getOption(Memcached::OPT_SERIALIZER) == Memcached::SERIALIZER_PHP); -var_dump($m->getOption(Memcached::OPT_COMPRESSION) == 0); -var_dump($m->getOption(Memcached::OPT_LIBKETAMA_COMPATIBLE) == 1); - -echo "test invalid options\n"; - -var_dump($m->setOptions(array( - "asdf" => 123 -))); - -var_dump($m->setOptions(array( - -1 => 123 -))); - ---EXPECTF-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -test invalid options - -Warning: Memcached::setOptions(): invalid configuration option in %s on line %d -bool(false) - -Warning: Memcached::setOptions(): error setting memcached option: %s in %s on line %d -bool(false)
View file
memcached-3.2.0.tgz/memcached-3.2.0/tests/touch_binary.phpt
Deleted
@@ -1,73 +0,0 @@ ---TEST-- -Touch in binary mode ---SKIPIF-- -<?php -$min_version = "1.4.8"; //TOUCH is added since 1.4.8 -include dirname(__FILE__) . "/skipif.inc"; -// The touch command in binary mode will work in libmemcached 1.0.16, but runs out the timeout clock -// See https://github.com/php-memcached-dev/php-memcached/issues/310 for further explanation -// The problem is fixed fully in libmemcached 1.0.18, so we'll focus tests on that version -if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x01000018) die ('skip too old libmemcached'); -?> ---FILE-- -<?php - -function resolve_to_constant ($code) -{ - $refl = new ReflectionClass ('memcached'); - $c = $refl->getConstants (); - - foreach ($c as $name => $value) { - if (strpos ($name, 'RES_') === 0 && $value == $code) - return $name; - } -} - -function status_print ($op, $mem, $expected) -{ - $code = $mem->getResultcode(); - - if ($code == $expected) - echo "${op} status code as expected" . PHP_EOL; - else { - $expected = resolve_to_constant ($expected); - $code = resolve_to_constant ($code); - - echo "${op} status code mismatch, expected ${expected} but got ${code}" . PHP_EOL; - } -} - -include dirname (__FILE__) . '/config.inc'; -$mem = memc_get_instance (array (Memcached::OPT_BINARY_PROTOCOL => true)); - -$key = uniqid ('touch_t_'); - -$mem->get($key); -status_print ('get', $mem, Memcached::RES_NOTFOUND); - -$mem->set ($key, 1); -status_print ('set', $mem, Memcached::RES_SUCCESS); - -$mem->get($key); -status_print ('get', $mem, Memcached::RES_SUCCESS); - -$mem->touch ($key, 10); -status_print ('touch', $mem, Memcached::RES_SUCCESS); - -$mem->get($key); -status_print ('get', $mem, Memcached::RES_SUCCESS); - -$mem->get($key); -status_print ('get', $mem, Memcached::RES_SUCCESS); - -echo "OK\n"; - -?> ---EXPECT-- -get status code as expected -set status code as expected -get status code as expected -touch status code as expected -get status code as expected -get status code as expected -OK
View file
memcached-3.3.0.tgz/memcached-3.3.0/CREDITS
Changed
(renamed from memcached-3.2.0/CREDITS)
View file
memcached-3.3.0.tgz/memcached-3.3.0/ChangeLog
Changed
(renamed from memcached-3.2.0/ChangeLog)
View file
memcached-3.3.0.tgz/memcached-3.3.0/LICENSE
Changed
(renamed from memcached-3.2.0/LICENSE)
View file
memcached-3.3.0.tgz/memcached-3.3.0/README.markdown
Added
@@ -0,0 +1,52 @@ +Build Status +------------ +!Build Status(https://github.com/php-memcached-dev/php-memcached/actions/workflows/build-and-test.yml/badge.svg?branch=master) + +Description +----------- +This is the PECL memcached(https://pecl.php.net/package/memcached) extension, +using the libmemcached library to connect to memcached servers. + +memcached(https://memcached.org) is a high-performance, distributed memory +object caching system, generic in nature, but intended for use in speeding up +dynamic web applications by alleviating database load. + +Building +-------- + + $ phpize + $ ./configure + $ make + $ make test + +Dependencies +------------ + +php-memcached 3.x: +* Supports PHP 7.0 - 8.3 or higher. +* Requires libmemcached 1.x or higher. +* Optionally supports igbinary 2.0 or higher. +* Optionally supports msgpack 2.0 or higher. + +php-memcached 2.x: +* Supports PHP 5.2 - 5.6. +* Requires libmemcached 0.44 or higher. +* Optionally supports igbinary 1.0 or higher. +* Optionally supports msgpack 0.5 or higher. + +libmemcached(http://libmemcached.org/libMemcached.html) or the new +libmemcached-awesome(https://github.com/awesomized/libmemcached) version +1.0.18 or higher is recommended for best performance and compatibility with +memcached servers. + +igbinary(https://github.com/igbinary/igbinary) is a faster and more compact +binary serializer for PHP data structures. When installing php-memcached from +source code, the igbinary module must be installed first so that php-memcached +can access its C header files. Load both modules in your `php.ini` at runtime +to begin using igbinary. + +msgpack(https://msgpack.org) is a faster and more compact data structure +representation that is interoperable with msgpack implementations for other +languages. When installing php-memcached from source code, the msgpack module +must be installed first so that php-memcached can access its C header files. +Load both modules in your `php.ini` at runtime to begin using msgpack.
View file
memcached-3.3.0.tgz/memcached-3.3.0/config.m4
Added
@@ -0,0 +1,419 @@ +dnl vim:se ts=2 sw=2 et: + +PHP_ARG_ENABLE(memcached, whether to enable memcached support, + --enable-memcached Enable memcached support) + +PHP_ARG_WITH(libmemcached-dir, for libmemcached, + --with-libmemcached-dir=DIR Set the path to libmemcached install prefix., yes) + +PHP_ARG_ENABLE(memcached-session, whether to enable memcached session handler support, + --enable-memcached-session Enable memcached session handler support, yes, no) + +PHP_ARG_ENABLE(memcached-igbinary, whether to enable memcached igbinary serializer support, + --enable-memcached-igbinary Enable memcached igbinary serializer support, no, no) + +PHP_ARG_ENABLE(memcached-json, whether to enable memcached json serializer support, + --enable-memcached-json Enable memcached json serializer support, no, no) + +PHP_ARG_ENABLE(memcached-msgpack, whether to enable memcached msgpack serializer support, + --enable-memcached-msgpack Enable memcached msgpack serializer support, no, no) + +PHP_ARG_ENABLE(memcached-sasl, whether to enable memcached sasl support, + --enable-memcached-sasl Enable memcached sasl support, yes, no) + +PHP_ARG_ENABLE(memcached-protocol, whether to enable memcached protocol support, + --enable-memcached-protocol Enable memcached protocol support, no, no) + +PHP_ARG_WITH(system-fastlz, whether to use system FastLZ library, + --with-system-fastlz Use system FastLZ library, no, no) + +PHP_ARG_WITH(zstd, whether to use system zstd library, + --with-zstd Use system zstd library, no, no) + +if test -z "$PHP_ZLIB_DIR"; then +PHP_ARG_WITH(zlib-dir, for ZLIB, + --with-zlib-dir=DIR Set the path to ZLIB install prefix., no) +fi + +if test -z "$PHP_DEBUG"; then + AC_ARG_ENABLE(debug, + --enable-debug Compile with debugging symbols, + PHP_DEBUG=$enableval + , PHP_DEBUG=no + ) +fi + +if test "$PHP_MEMCACHED" != "no"; then + + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + if test "x$PKG_CONFIG" = "xno"; then + AC_MSG_RESULT(pkg-config not found) + AC_MSG_ERROR(Please reinstall the pkg-config distribution) + fi + + dnl # zlib + if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then + if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then + PHP_ZLIB_DIR="$PHP_ZLIB_DIR" + PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" + elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then + PHP_ZLIB_DIR="$PHP_ZLIB_DIR" + PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" + else + AC_MSG_ERROR(Can't find ZLIB headers under "$PHP_ZLIB_DIR") + fi + else + for i in /usr/local /usr/local/opt/zlib /usr; do + if test -f "$i/include/zlib/zlib.h"; then + PHP_ZLIB_DIR="$i" + PHP_ZLIB_INCDIR="$i/include/zlib" + elif test -f "$i/include/zlib.h"; then + PHP_ZLIB_DIR="$i" + PHP_ZLIB_INCDIR="$i/include" + fi + done + fi + + AC_MSG_CHECKING(for zlib location) + if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then + AC_MSG_RESULT($PHP_ZLIB_DIR) + PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, MEMCACHED_SHARED_LIBADD) + PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) + else + AC_MSG_ERROR(memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located) + fi + + if test "$PHP_MEMCACHED_SESSION" != "no"; then + AC_MSG_CHECKING(for session includes) + session_inc_path="" + + if test -f "$abs_srcdir/include/php/ext/session/php_session.h"; then + session_inc_path="$abs_srcdir/include/php" + elif test -f "$abs_srcdir/ext/session/php_session.h"; then + session_inc_path="$abs_srcdir" + elif test -f "$phpincludedir/ext/session/php_session.h"; then + session_inc_path="$phpincludedir" + else + for i in php php4 php5 php6; do + if test -f "$prefix/include/$i/ext/session/php_session.h"; then + session_inc_path="$prefix/include/$i" + fi + done + fi + + if test "$session_inc_path" = ""; then + AC_MSG_ERROR(Cannot find php_session.h) + else + AC_MSG_RESULT($session_inc_path) + fi + fi + + if test "$PHP_MEMCACHED_JSON" != "no"; then + AC_MSG_CHECKING(for json includes) + json_inc_path="" + + if test -f "$abs_srcdir/include/php/ext/json/php_json.h"; then + json_inc_path="$abs_srcdir/include/php" + elif test -f "$abs_srcdir/ext/json/php_json.h"; then + json_inc_path="$abs_srcdir" + elif test -f "$phpincludedir/ext/json/php_json.h"; then + json_inc_path="$phpincludedir" + else + for i in php php4 php5 php6; do + if test -f "$prefix/include/$i/ext/json/php_json.h"; then + json_inc_path="$prefix/include/$i" + fi + done + fi + if test "$json_inc_path" = ""; then + AC_MSG_ERROR(Cannot find php_json.h) + else + AC_DEFINE(HAVE_JSON_API,1,Whether JSON API is available) + AC_MSG_RESULT($json_inc_path) + fi + fi + + if test "$PHP_MEMCACHED_IGBINARY" != "no"; then + AC_MSG_CHECKING(for igbinary includes) + igbinary_inc_path="" + + if test -f "$abs_srcdir/include/php/ext/igbinary/igbinary.h"; then + igbinary_inc_path="$abs_srcdir/include/php" + elif test -f "$abs_srcdir/ext/igbinary/igbinary.h"; then + igbinary_inc_path="$abs_srcdir" + elif test -f "$phpincludedir/ext/session/igbinary.h"; then + igbinary_inc_path="$phpincludedir" + elif test -f "$phpincludedir/ext/igbinary/igbinary.h"; then + igbinary_inc_path="$phpincludedir" + else + for i in php php4 php5 php6; do + if test -f "$prefix/include/$i/ext/igbinary/igbinary.h"; then + igbinary_inc_path="$prefix/include/$i" + fi + done + fi + + if test "$igbinary_inc_path" = ""; then + AC_MSG_ERROR(Cannot find igbinary.h) + else + AC_MSG_RESULT($igbinary_inc_path) + fi + fi + + if test "$PHP_MEMCACHED_MSGPACK" != "no"; then + AC_MSG_CHECKING(for msgpack includes) + msgpack_inc_path="" + + if test -f "$abs_srcdir/include/php/ext/msgpack/php_msgpack.h"; then + msgpack_inc_path="$abs_srcdir/include/php" + elif test -f "$abs_srcdir/ext/msgpack/php_msgpack.h"; then + msgpack_inc_path="$abs_srcdir" + elif test -f "$phpincludedir/ext/session/php_msgpack.h"; then + msgpack_inc_path="$phpincludedir" + elif test -f "$phpincludedir/ext/msgpack/php_msgpack.h"; then + msgpack_inc_path="$phpincludedir" + else + for i in php php4 php5 php6; do + if test -f "$prefix/include/$i/ext/msgpack/php_msgpack.h"; then + msgpack_inc_path="$prefix/include/$i" + fi + done + fi + + if test "$msgpack_inc_path" = ""; then + AC_MSG_ERROR(Cannot find php_msgpack.h) + else + AC_MSG_RESULT($msgpack_inc_path) + fi + fi + + AC_MSG_CHECKING(for memcached session support) + if test "$PHP_MEMCACHED_SESSION" != "no"; then + AC_MSG_RESULT(enabled) + AC_DEFINE(HAVE_MEMCACHED_SESSION,1,Whether memcache session handler is enabled) + SESSION_INCLUDES="-I$session_inc_path" + ifdef(PHP_ADD_EXTENSION_DEP, + + PHP_ADD_EXTENSION_DEP(memcached, session) + ) + else
View file
memcached-3.3.0.tgz/memcached-3.3.0/config.w32
Added
@@ -0,0 +1,50 @@ +// vim:ft=javascript + +ARG_ENABLE('memcached', 'libmemcached extension', 'no'); + +ARG_ENABLE('memcached-session', 'whether to enable memcached session handler support', 'no'); +ARG_ENABLE('memcached-igbinary', 'whether to enable memcached igbinary serializer support', 'no'); +ARG_ENABLE('memcached-json', 'whether to enable memcached json serializer support', 'no'); +ARG_ENABLE('memcached-msgpack', 'whether to enable memcached msgpack serializer support', 'no'); + +if (PHP_MEMCACHED == "yes") { + + if (!CHECK_LIB("memcached.lib;libmemcached.lib", "memcached", PHP_MEMCACHED)) { + ERROR("memcached: library 'memcached' not found"); + } + + if (!CHECK_HEADER_ADD_INCLUDE("libmemcached/memcached.h", "CFLAGS_MEMCACHED")) { + ERROR("memcached: header 'libmemcached/memcached.h' not found"); + } + + if (PHP_MEMCACHED_JSON != "no"){ + AC_DEFINE("HAVE_JSON_API",1); + } + + var memcached_extra_src = ""; + + if (PHP_MEMCACHED_SESSION != "no"){ + AC_DEFINE("HAVE_MEMCACHED_SESSION",1); + ADD_EXTENSION_DEP("memcached", "session", true) + memcached_extra_src += " php_memcached_session.c"; + } + + if (PHP_MEMCACHED_IGBINARY != "no"){ + AC_DEFINE("HAVE_MEMCACHED_IGBINARY",1); + ADD_EXTENSION_DEP("memcached", "igbinary", true); + if (!CHECK_HEADER_ADD_INCLUDE("igbinary.h", "CFLAGS_MEMCACHED")) { + ERROR("memcached: header 'igbinary.h' not found"); + } + } + if (PHP_MEMCACHED_MSGPACK != "no"){ + AC_DEFINE("HAVE_MEMCACHED_MSGPACK",1); + ADD_EXTENSION_DEP("memcached", "msgpack", true); + if (!CHECK_HEADER_ADD_INCLUDE("php_msgpack.h", "CFLAGS_MEMCACHED")) { + ERROR("memcached: header 'php_msgpack.h' not found"); + } + } + EXTENSION("memcached", "php_memcached.c php_libmemcached_compat.c g_fmt.c"+memcached_extra_src, null, " /DHAVE_SSIZE_T"); + ADD_SOURCES(configure_module_dirname+"\\fastlz", "fastlz.c", "memcached"); + AC_DEFINE("HAVE_MEMCACHED", 1, "memcached support"); + AC_DEFINE("MEMCACHED_EXPORTS", 1) +}
View file
memcached-3.3.0.tgz/memcached-3.3.0/fastlz/LICENSE
Changed
(renamed from memcached-3.2.0/fastlz/LICENSE)
View file
memcached-3.3.0.tgz/memcached-3.3.0/fastlz/fastlz.c
Changed
(renamed from memcached-3.2.0/fastlz/fastlz.c)
View file
memcached-3.3.0.tgz/memcached-3.3.0/fastlz/fastlz.h
Changed
(renamed from memcached-3.2.0/fastlz/fastlz.h)
View file
memcached-3.3.0.tgz/memcached-3.3.0/g_fmt.c
Changed
(renamed from memcached-3.2.0/g_fmt.c)
View file
memcached-3.3.0.tgz/memcached-3.3.0/g_fmt.h
Changed
(renamed from memcached-3.2.0/g_fmt.h)
View file
memcached-3.3.0.tgz/memcached-3.3.0/memcached-api.php
Changed
(renamed from memcached-3.2.0/memcached-api.php)
View file
memcached-3.3.0.tgz/memcached-3.3.0/memcached.ini
Added
@@ -0,0 +1,169 @@ +memcached +; Use session locking +; valid values: On, Off +; the default is On +;memcached.sess_locking = On + +; The minimum time, in milliseconds, to wait between session lock attempts. +; This value is double on each lock retry until memcached.sess_lock_wait_max +; is reached, after which any further retries will take sess_lock_wait_max seconds. +; Default is 150. +;memcached.sess_lock_wait_min = 150; + +; The maximum time, in milliseconds, to wait between session lock attempts. +; Default is 150. +;memcached.sess_lock_wait_max = 150; + +; The number of times to retry locking the session lock, not including the first attempt. +; Default is 5. +;memcached.sess_lock_retries = 5; + +; The time, in seconds, before a lock should release itself. +; Setting to 0 results in the default behaviour, which is to +; use PHP's max_execution_time. +;memcached.sess_lock_expire = 0; + +; memcached session key prefix +; valid values are strings less than 219 bytes long +; the default value is "memc.sess.key." +;memcached.sess_prefix = "memc.sess.key." + +; Whether or not to re-use the memcached connections corresponding to the value(s) +; of session.save_path after the execution of the script ends. +; Don't use this if certain settings (e.g. SASL settings, sess_binary_protocol) would +; be overridden between requests. +; Default is Off. +;memcached.sess_persistent = Off + +; memcached session consistent hash mode +; if set to On, consistent hashing (libketama) is used +; for session handling. +; When consistent hashing is used, one can add or remove cache +; node(s) without messing up too much with existing keys +; default is On +;memcached.sess_consistent_hash = On + +; memcached session consistent hash type +; if set to 'ketama', consistent hashing (libketama) is used +; for session handling (default for php-memcached 3.x) +; if set to 'ketama_weighted', weighted consistent hashing (libketama) is used +; for session handling (default for php-memcached 2.x) +;memcached.sess_consistent_hash_type = "ketama" + +; Allow failed memcached server to automatically be removed. +; Default is Off. (In previous versions, this setting was called memcached.sess_remove_failed) +;memcached.sess_remove_failed_servers = Off + +; Set this value to enable the server be removed after +; configured number of continuous times connection failure. +;memcached.sess_server_failure_limit = 0 + +; Write data to a number of additional memcached servers +; This is "poor man's HA" as libmemcached calls it. +; If this value is positive and sess_remove_failed_servers is enabled +; when a memcached server fails the session will continue to be available +; from a replica. However, if the failed memcache server +; becomes available again it will read the session from there +; which could have old data or no data at all +;memcached.sess_number_of_replicas = 0 + +; Use the memcached binary protocol for memcached sessions (Instead of the text protocol) +; libmemcached replicas work only if binary mode is enabled. +; However, certain proxies (such as twemproxy) will work only if the binary protocol is disabled. +; In older versions of php-memcached, this setting was Off and was called memcached.sess_binary. +; Default is On with libmemcached 1.0.18 or newer. +; Default is Off with older version. +;memcached.sess_binary_protocol = On + +; memcached session replica read randomize +;memcached.sess_randomize_replica_read = Off + +; memcached connect timeout value +; In non-blocking mode this changes the value of the timeout +; during socket connection in milliseconds. Specifying -1 means an infinite timeout. +;memcached.sess_connect_timeout = 1000 + +; Session SASL username +; Both username and password need to be set for SASL to be enabled +;memcached.sess_sasl_username = NULL + +; Session SASL password +;memcached.sess_sasl_password = NULL + +; Set the compression type +; valid values are: fastlz, zlib +; the default is fastlz +;memcached.compression_type = "fastlz" + +; Compression factor +; Store compressed value only if the compression +; factor (saving) exceeds the set limit. +; +; store compressed if: +; plain_len > comp_len * factor +; +; the default value is 1.3 (23% space saving) +;memcached.compression_factor = "1.3" + +; The compression threshold +; +; Do not compress serialized values below this threshold. +; the default is 2000 bytes +;memcached.compression_threshold = 2000 + +; Set the default serializer for new memcached objects. +; valid values are: php, igbinary, json, json_array, msgpack +; +; json - standard php JSON encoding. This serializer +; is fast and compact but only works on UTF-8 +; encoded data and does not fully implement +; serializing. See the JSON extension. +; json_array - as json, but decodes into arrays +; php - the standard php serializer +; igbinary - a binary serializer +; msgpack - a cross-language binary serializer +; +; The default is igbinary if available, then msgpack if available, then php otherwise. +;memcached.serializer = "igbinary" + +; The amount of retries for failed store commands. +; This mechanism allows transparent fail-over to secondary servers when +; set/increment/decrement/setMulti operations fail on the desired server in a multi-server +; environment. +; the default is 0 +;memcached.store_retry_count = 0 + +; The maximum payload size in bytes that can be written. +; Writing a payload larger than the limit will result in RES_E2BIG error. +; Specifying 0 means no limit is enforced, though the server may still reject with RES_E2BIG. +; Default is 0. +;memcached.item_size_limit = 1000000 + +; Sets the default for consistent hashing for new connections. +; (To configure consistent hashing for session connections, +; use memcached.sess_consistent_hash instead) +; +; If set to On, consistent hashing (libketama) is used +; for session handling. +; When consistent hashing is used, one can add or remove cache +; node(s) without messing up too much with existing keys +; default is Off +;memcached.default_consistent_hash = Off + +; Sets the default memcached protocol for new connections. +; (To configure the memcached protocol for connections used by sessions, +; use memcached.sess_binary_protocol instead) +; +; If set to On, the memcached binary protocol is used by default. +; If set to Off, the memcached text protocol is used. +; Default is Off +;memcached.default_binary_protocol = Off + +; Sets the default memcached connection timeout for new connections. +; (To configure the memcached connection timeout for sessions, +; use memcached.sess_connect_timeout instead) +; In non-blocking mode this changes the value of the timeout. +; during socket connection in milliseconds. Specifying -1 means an infinite timeout. +; Specifying 0 means using the memcached library's default connection timeout. +; Default is 0. +;memcached.default_connect_timeout = 0
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_libmemcached_compat.c
Changed
(renamed from memcached-3.2.0/php_libmemcached_compat.c)
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_libmemcached_compat.h
Changed
(renamed from memcached-3.2.0/php_libmemcached_compat.h)
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached.c
Added
@@ -0,0 +1,4528 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) 2009-2010 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andrei Zmievski <andrei@php.net> | + +----------------------------------------------------------------------+ +*/ + +/* TODO + * - set LIBKETAMA_COMPATIBLE as the default? + * - fix unserialize(serialize($memc)) + */ + +#include "php_memcached.h" +#include "php_memcached_private.h" +#include "php_memcached_server.h" +#include "g_fmt.h" + +#include <ctype.h> +#include <limits.h> + +#ifdef HAVE_MEMCACHED_SESSION +# include "php_memcached_session.h" +#endif +#ifdef HAVE_FASTLZ_H +#include <fastlz.h> +#else +#include "fastlz/fastlz.h" +#endif +#include <zlib.h> + +#ifdef HAVE_ZSTD_H +#include <zstd.h> +#endif + +#ifdef HAVE_JSON_API +# include "ext/json/php_json.h" +#endif + +#ifdef HAVE_MEMCACHED_IGBINARY +#ifdef PHP_WIN32 +//Windows extensions are generally built together, +//so it wont be in the installed location +#include "igbinary.h" +#else +# include "ext/igbinary/igbinary.h" +#endif +#endif + +#ifdef HAVE_MEMCACHED_MSGPACK +# include "ext/msgpack/php_msgpack.h" +#endif + +# include "ext/spl/spl_exceptions.h" + +static int le_memc; + +static int php_memc_list_entry(void) { + return le_memc; +} + +/**************************************** + Protocol parameters +****************************************/ +#define MEMC_OBJECT_KEY_MAX_LENGTH 250 + +/**************************************** + Custom options +****************************************/ +#define MEMC_OPT_COMPRESSION -1001 +#define MEMC_OPT_PREFIX_KEY -1002 +#define MEMC_OPT_SERIALIZER -1003 +#define MEMC_OPT_COMPRESSION_TYPE -1004 +#define MEMC_OPT_STORE_RETRY_COUNT -1005 +#define MEMC_OPT_USER_FLAGS -1006 +#define MEMC_OPT_COMPRESSION_LEVEL -1007 +#define MEMC_OPT_ITEM_SIZE_LIMIT -1008 + +/**************************************** + Custom result codes +****************************************/ +#define MEMC_RES_PAYLOAD_FAILURE -1001 + +/**************************************** + Payload value flags +****************************************/ +#define MEMC_CREATE_MASK(start, n_bits) (((1U << n_bits) - 1) << start) + +#define MEMC_MASK_TYPE MEMC_CREATE_MASK(0, 4) +#define MEMC_MASK_INTERNAL MEMC_CREATE_MASK(4, 12) +#define MEMC_MASK_USER MEMC_CREATE_MASK(16, 16) + +#define MEMC_VAL_GET_TYPE(flags) ((flags) & MEMC_MASK_TYPE) +#define MEMC_VAL_SET_TYPE(flags, type) ((flags) |= ((type) & MEMC_MASK_TYPE)) + +#define MEMC_VAL_IS_STRING 0 +#define MEMC_VAL_IS_LONG 1 +#define MEMC_VAL_IS_DOUBLE 2 +#define MEMC_VAL_IS_BOOL 3 +#define MEMC_VAL_IS_SERIALIZED 4 +#define MEMC_VAL_IS_IGBINARY 5 +#define MEMC_VAL_IS_JSON 6 +#define MEMC_VAL_IS_MSGPACK 7 + +#define MEMC_VAL_COMPRESSED (1<<0) +#define MEMC_VAL_COMPRESSION_ZLIB (1<<1) +#define MEMC_VAL_COMPRESSION_FASTLZ (1<<2) +#define MEMC_VAL_COMPRESSION_ZSTD (1<<3) + +#define MEMC_VAL_GET_FLAGS(internal_flags) (((internal_flags) & MEMC_MASK_INTERNAL) >> 4) +#define MEMC_VAL_SET_FLAG(internal_flags, internal_flag) ((internal_flags) |= (((internal_flag) << 4) & MEMC_MASK_INTERNAL)) +#define MEMC_VAL_HAS_FLAG(internal_flags, internal_flag) ((MEMC_VAL_GET_FLAGS(internal_flags) & (internal_flag)) == (internal_flag)) +#define MEMC_VAL_DEL_FLAG(internal_flags, internal_flag) (internal_flags &= (~(((internal_flag) << 4) & MEMC_MASK_INTERNAL))) + +/**************************************** + User-defined flags +****************************************/ +#define MEMC_VAL_GET_USER_FLAGS(flags) ((flags & MEMC_MASK_USER) >> 16) +#define MEMC_VAL_SET_USER_FLAGS(flags, udf_flags) ((flags) |= ((udf_flags << 16) & MEMC_MASK_USER)) +#define MEMC_VAL_USER_FLAGS_MAX ((1 << 16) - 1) + +/**************************************** + "get" operation flags +****************************************/ +#define MEMC_GET_PRESERVE_ORDER 1 +#define MEMC_GET_EXTENDED 2 + +/**************************************** + Helper macros +****************************************/ +#define RETURN_FROM_GET RETURN_FALSE + +/**************************************** + Structures and definitions +****************************************/ + +typedef enum { + MEMC_OP_SET, + MEMC_OP_TOUCH, + MEMC_OP_ADD, + MEMC_OP_REPLACE, + MEMC_OP_APPEND, + MEMC_OP_PREPEND +} php_memc_write_op; + +typedef struct { + + zend_bool is_persistent; + zend_bool compression_enabled; + zend_bool encoding_enabled; + + zend_long serializer; + zend_long compression_type; + zend_long compression_level; + + zend_long store_retry_count; + zend_long set_udf_flags; + zend_long item_size_limit; + +#ifdef HAVE_MEMCACHED_SASL + zend_bool has_sasl_data; +#endif +} php_memc_user_data_t; + +typedef struct { + memcached_st *memc; + zend_bool is_pristine; + int rescode; + int memc_errno; + zend_object zo; +} php_memc_object_t; + +typedef struct { + size_t num_valid_keys; + + const char **mkeys; + size_t *mkeys_len; + + zend_string **strings; + +} php_memc_keys_t; + +typedef struct { + zval *object; + zend_fcall_info fci; + zend_fcall_info_cache fcc; +} php_memc_result_callback_ctx_t; + +static inline php_memc_object_t *php_memc_fetch_object(zend_object *obj) { + return (php_memc_object_t *)((char *)obj - XtOffsetOf(php_memc_object_t, zo)); +}
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached.h
Added
@@ -0,0 +1,57 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) 2009 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.0 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_0.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andrei Zmievski <andrei@php.net> | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_MEMCACHED_H +#define PHP_MEMCACHED_H + +#include "php.h" +#include "Zend/zend_smart_str.h" + +#ifdef PHP_WIN32 +#include "main/config.w32.h" +#else +#include "main/php_config.h" +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#define PHP_MEMCACHED_VERSION "3.3.0" + +#if defined(PHP_WIN32) && defined(MEMCACHED_EXPORTS) +#define PHP_MEMCACHED_API __declspec(dllexport) +#else +#define PHP_MEMCACHED_API PHPAPI +#endif + +PHP_MEMCACHED_API zend_class_entry *php_memc_get_ce(void); +PHP_MEMCACHED_API zend_class_entry *php_memc_get_exception(void); +PHP_MEMCACHED_API zend_class_entry *php_memc_get_exception_base(int root); + +extern zend_module_entry memcached_module_entry; +#define phpext_memcached_ptr &memcached_module_entry + +#endif /* PHP_MEMCACHED_H */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached.stub.php
Added
@@ -0,0 +1,95 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo + * @generate-class-entries + */ + +class Memcached { + + public function __construct(?string $persistent_id=null, ?callable $callback=null, ?string $connection_str=null) {} + + public function getResultCode(): int {} + public function getResultMessage(): string {} + + public function get(string $key, ?callable $cache_cb=null, int $get_flags=0): mixed {} + public function getByKey(string $server_key, string $key, ?callable $cache_cb=null, int $get_flags=0): mixed {} + public function getMulti(array $keys, int $get_flags=0): array|false {} + public function getMultiByKey(string $server_key, array $keys, int $get_flags=0): array|false {} + public function getDelayed(array $keys, bool $with_cas=false, ?callable $value_cb=null): bool {} + public function getDelayedByKey(string $server_key, array $keys, bool $with_cas=false, ?callable $value_cb=null): bool {} + public function fetch(): array|false {} + public function fetchAll(): array|false {} + + public function set(string $key, mixed $value, int $expiration=0): bool {} + public function setByKey(string $server_key, string $key, mixed $value, int $expiration=0): bool {} + + public function touch(string $key, int $expiration=0): bool {} + public function touchByKey(string $server_key, string $key, int $expiration=0): bool {} + + public function setMulti(array $items, int $expiration=0): bool {} + public function setMultiByKey(string $server_key, array $items, int $expiration=0): bool {} + + public function cas(string|int|float $cas_token, string $key, mixed $value, int $expiration=0): bool {} + public function casByKey(string|int|float $cas_token, string $server_key, string $key, mixed $value, int $expiration=0): bool {} + public function add(string $key, mixed $value, int $expiration=0): bool {} + public function addByKey(string $server_key, string $key, mixed $value, int $expiration=0): bool {} + public function append(string $key, string $value): ?bool {} + public function appendByKey(string $server_key, string $key, string $value): ?bool {} + public function prepend(string $key, string $value): ?bool {} + public function prependByKey(string $server_key, string $key, string $value): ?bool {} + public function replace(string $key, mixed $value, int $expiration=0): bool {} + public function replaceByKey(string $server_key, string $key, mixed $value, int $expiration=0): bool {} + public function delete(string $key, int $time=0): bool {} + public function deleteMulti(array $keys, int $time=0): array {} + public function deleteByKey(string $server_key, string $key, int $time=0): bool {} + public function deleteMultiByKey(string $server_key, array $keys, int $time=0): array {} + + public function increment(string $key, int $offset=1, int $initial_value=0, int $expiry=0): int|false {} + public function decrement(string $key, int $offset=1, int $initial_value=0, int $expiry=0): int|false {} + public function incrementByKey(string $server_key, string $key, int $offset=1, int $initial_value=0, int $expiry=0): int|false {} + public function decrementByKey(string $server_key, string $key, int $offset=1, int $initial_value=0, int $expiry=0): int|false {} + + public function addServer(string $host, int $port, int $weight=0): bool {} + public function addServers(array $servers): bool {} + public function getServerList(): array {} + public function getServerByKey(string $server_key): array|false {} + public function resetServerList(): bool {} + public function quit(): bool {} + public function flushBuffers(): bool {} + + public function getLastErrorMessage(): string {} + public function getLastErrorCode(): int {} + public function getLastErrorErrno(): int {} + public function getLastDisconnectedServer(): array|false {} + + public function getStats(?string $type=null): array|false {} + public function getVersion(): array|false {} + public function getAllKeys(): array|false {} + + public function flush(int $delay=0): bool {} + + public function getOption(int $option): mixed {} + public function setOption(int $option, mixed $value): bool {} + public function setOptions(array $options): bool {} + public function setBucket(array $host_map, ?array $forward_map, int $replicas): bool {} +#ifdef HAVE_MEMCACHED_SASL + public function setSaslAuthData(string $username, #\SensitiveParameter string $password): bool {} +#endif + +#ifdef HAVE_MEMCACHED_SET_ENCODING_KEY + public function setEncodingKey(string $key): bool {} +#endif + public function isPersistent(): bool {} + public function isPristine(): bool {} + public function checkKey(string $key): bool {} +} + +#if defined(HAVE_MEMCACHED_PROTOCOL) +class MemcachedServer { + + public function run(string $address): bool {} + public function on(int $event, callable $callback): bool {} +} +#endif
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached_arginfo.h
Added
@@ -0,0 +1,444 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 75604abd7f58655a9ebda6f0ea579840311c1f08 */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, persistent_id, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, connection_str, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getResultCode, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getResultMessage, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_get, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cache_cb, IS_CALLABLE, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getByKey, 0, 2, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cache_cb, IS_CALLABLE, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_getMulti, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_getMultiByKey, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_flags, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getDelayed, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, with_cas, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value_cb, IS_CALLABLE, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getDelayedByKey, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, with_cas, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value_cb, IS_CALLABLE, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_fetch, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_fetchAll arginfo_class_Memcached_fetch + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_set, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_setByKey, 0, 3, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_touch, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_touchByKey, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_setMulti, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, items, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_setMultiByKey, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, items, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_cas, 0, 3, _IS_BOOL, 0) + ZEND_ARG_TYPE_MASK(0, cas_token, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_casByKey, 0, 4, _IS_BOOL, 0) + ZEND_ARG_TYPE_MASK(0, cas_token, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiration, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_add arginfo_class_Memcached_set + +#define arginfo_class_Memcached_addByKey arginfo_class_Memcached_setByKey + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_append, 0, 2, _IS_BOOL, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_appendByKey, 0, 3, _IS_BOOL, 1) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_prepend arginfo_class_Memcached_append + +#define arginfo_class_Memcached_prependByKey arginfo_class_Memcached_appendByKey + +#define arginfo_class_Memcached_replace arginfo_class_Memcached_set + +#define arginfo_class_Memcached_replaceByKey arginfo_class_Memcached_setByKey + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_delete, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_deleteMulti, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_deleteByKey, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_deleteMultiByKey, 0, 2, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_increment, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, initial_value, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiry, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_decrement arginfo_class_Memcached_increment + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_incrementByKey, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, initial_value, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, expiry, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_decrementByKey arginfo_class_Memcached_incrementByKey + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_addServer, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, weight, IS_LONG, 0, "0") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_addServers, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, servers, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_getServerList, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Memcached_getServerByKey, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Memcached_resetServerList, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_quit arginfo_class_Memcached_resetServerList + +#define arginfo_class_Memcached_flushBuffers arginfo_class_Memcached_resetServerList + +#define arginfo_class_Memcached_getLastErrorMessage arginfo_class_Memcached_getResultMessage + +#define arginfo_class_Memcached_getLastErrorCode arginfo_class_Memcached_getResultCode +
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached_legacy_arginfo.h
Added
@@ -0,0 +1,433 @@ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 75604abd7f58655a9ebda6f0ea579840311c1f08 */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached___construct, 0, 0, 0) + ZEND_ARG_INFO(0, persistent_id) + ZEND_ARG_INFO(0, callback) + ZEND_ARG_INFO(0, connection_str) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getResultCode, 0, 0, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_getResultMessage arginfo_class_Memcached_getResultCode + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_get, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, cache_cb) + ZEND_ARG_INFO(0, get_flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, cache_cb) + ZEND_ARG_INFO(0, get_flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getMulti, 0, 0, 1) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, get_flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getMultiByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, get_flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getDelayed, 0, 0, 1) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, with_cas) + ZEND_ARG_INFO(0, value_cb) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getDelayedByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, with_cas) + ZEND_ARG_INFO(0, value_cb) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_fetch arginfo_class_Memcached_getResultCode + +#define arginfo_class_Memcached_fetchAll arginfo_class_Memcached_getResultCode + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_set, 0, 0, 2) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_setByKey, 0, 0, 3) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_touch, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_touchByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_setMulti, 0, 0, 1) + ZEND_ARG_INFO(0, items) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_setMultiByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, items) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_cas, 0, 0, 3) + ZEND_ARG_INFO(0, cas_token) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_casByKey, 0, 0, 4) + ZEND_ARG_INFO(0, cas_token) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, expiration) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_add arginfo_class_Memcached_set + +#define arginfo_class_Memcached_addByKey arginfo_class_Memcached_setByKey + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_append, 0, 0, 2) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_appendByKey, 0, 0, 3) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_prepend arginfo_class_Memcached_append + +#define arginfo_class_Memcached_prependByKey arginfo_class_Memcached_appendByKey + +#define arginfo_class_Memcached_replace arginfo_class_Memcached_set + +#define arginfo_class_Memcached_replaceByKey arginfo_class_Memcached_setByKey + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_delete, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, time) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_deleteMulti, 0, 0, 1) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, time) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_deleteByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, time) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_deleteMultiByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, time) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_increment, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, initial_value) + ZEND_ARG_INFO(0, expiry) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_decrement arginfo_class_Memcached_increment + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_incrementByKey, 0, 0, 2) + ZEND_ARG_INFO(0, server_key) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, initial_value) + ZEND_ARG_INFO(0, expiry) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_decrementByKey arginfo_class_Memcached_incrementByKey + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_addServer, 0, 0, 2) + ZEND_ARG_INFO(0, host) + ZEND_ARG_INFO(0, port) + ZEND_ARG_INFO(0, weight) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_addServers, 0, 0, 1) + ZEND_ARG_INFO(0, servers) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_getServerList arginfo_class_Memcached_getResultCode + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Memcached_getServerByKey, 0, 0, 1) + ZEND_ARG_INFO(0, server_key) +ZEND_END_ARG_INFO() + +#define arginfo_class_Memcached_resetServerList arginfo_class_Memcached_getResultCode + +#define arginfo_class_Memcached_quit arginfo_class_Memcached_getResultCode + +#define arginfo_class_Memcached_flushBuffers arginfo_class_Memcached_getResultCode + +#define arginfo_class_Memcached_getLastErrorMessage arginfo_class_Memcached_getResultCode + +#define arginfo_class_Memcached_getLastErrorCode arginfo_class_Memcached_getResultCode + +#define arginfo_class_Memcached_getLastErrorErrno arginfo_class_Memcached_getResultCode + +#define arginfo_class_Memcached_getLastDisconnectedServer arginfo_class_Memcached_getResultCode +
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached_private.h
Added
@@ -0,0 +1,255 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) 2009 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.0 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_0.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andrei Zmievski <andrei@php.net> | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_MEMCACHED_PRIVATE_H +#define PHP_MEMCACHED_PRIVATE_H + +#ifdef PHP_WIN32 +#include "main/config.w32.h" +#else +#include "main/php_config.h" +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "php_libmemcached_compat.h" + +#include <stdlib.h> +#include <string.h> +#include <php.h> +#include <php_main.h> + +#ifdef ZTS +# include "TSRM.h" +#endif + +#include <php_ini.h> +#include <SAPI.h> +#include <ext/standard/info.h> +#include <zend_extensions.h> +#include <zend_exceptions.h> +#include <ext/standard/php_smart_string.h> +#include <ext/standard/php_var.h> +#include <ext/standard/basic_functions.h> + +#ifdef PHP_WIN32 + # if PHP_VERSION_ID >= 80000 + # include <stdint.h> + #else + # include "win32/php_stdint.h" + #endif +#else +/* Used to store the size of the block */ +# if defined(HAVE_INTTYPES_H) +# include <inttypes.h> +# elif defined(HAVE_STDINT_H) +# include <stdint.h> +# endif +#endif + +#ifndef HAVE_INT32_T +# if SIZEOF_INT == 4 +typedef int int32_t; +# elif SIZEOF_LONG == 4 +typedef long int int32_t; +# endif +#endif + +#ifndef HAVE_UINT32_T +# if SIZEOF_INT == 4 +typedef unsigned int uint32_t; +# elif SIZEOF_LONG == 4 +typedef unsigned long int uint32_t; +# endif +#endif + +/* Backwards compatibility for GC API change in PHP 7.3 */ +#if PHP_VERSION_ID < 70300 +# define GC_ADDREF(p) ++GC_REFCOUNT(p) +# define GC_DELREF(p) --GC_REFCOUNT(p) +# define GC_SET_REFCOUNT(p, rc) GC_REFCOUNT(p) = rc +#endif + +/**************************************** + Structures and definitions +****************************************/ +typedef enum { + SERIALIZER_PHP = 1, + SERIALIZER_IGBINARY = 2, + SERIALIZER_JSON = 3, + SERIALIZER_JSON_ARRAY = 4, + SERIALIZER_MSGPACK = 5 +} php_memc_serializer_type; + +typedef enum { + COMPRESSION_TYPE_ZLIB = 1, + COMPRESSION_TYPE_FASTLZ = 2, + COMPRESSION_TYPE_ZSTD = 3 +} php_memc_compression_type; + +typedef struct { + const char *name; + php_memc_serializer_type type; +} php_memc_serializer; + +#if defined(HAVE_MEMCACHED_IGBINARY) +# define SERIALIZER_DEFAULT SERIALIZER_IGBINARY +# define SERIALIZER_DEFAULT_NAME "igbinary" +#elif defined(HAVE_MEMCACHED_MSGPACK) +# define SERIALIZER_DEFAULT SERIALIZER_MSGPACK +# define SERIALIZER_DEFAULT_NAME "msgpack" +#else +# define SERIALIZER_DEFAULT SERIALIZER_PHP +# define SERIALIZER_DEFAULT_NAME "php" +#endif /* HAVE_MEMCACHED_IGBINARY / HAVE_MEMCACHED_MSGPACK */ + +#ifdef HAVE_MEMCACHED_SASL +# include <sasl/sasl.h> +#endif + +#ifdef HAVE_MEMCACHED_PROTOCOL +typedef enum { + MEMC_SERVER_ON_MIN = -1, + MEMC_SERVER_ON_CONNECT = 0, + MEMC_SERVER_ON_ADD = 1, + MEMC_SERVER_ON_APPEND = 2, + MEMC_SERVER_ON_DECREMENT = 3, + MEMC_SERVER_ON_DELETE = 4, + MEMC_SERVER_ON_FLUSH = 5, + MEMC_SERVER_ON_GET = 6, + MEMC_SERVER_ON_INCREMENT = 7, + MEMC_SERVER_ON_NOOP = 8, + MEMC_SERVER_ON_PREPEND = 9, + MEMC_SERVER_ON_QUIT = 10, + MEMC_SERVER_ON_REPLACE = 11, + MEMC_SERVER_ON_SET = 12, + MEMC_SERVER_ON_STAT = 13, + MEMC_SERVER_ON_VERSION = 14, + MEMC_SERVER_ON_MAX +} php_memc_event_t; + + +typedef struct { + zend_fcall_info fci; + zend_fcall_info_cache fci_cache; +} php_memc_server_cb_t; +#endif + +ZEND_BEGIN_MODULE_GLOBALS(php_memcached) + +#ifdef HAVE_MEMCACHED_SESSION + /* Session related variables */ + struct { + zend_bool lock_enabled; + zend_long lock_wait_max; + zend_long lock_wait_min; + zend_long lock_retries; + zend_long lock_expiration; + + zend_bool binary_protocol_enabled; + zend_bool consistent_hash_enabled; + char *consistent_hash_name; + int consistent_hash_type; + + zend_long server_failure_limit; + zend_long number_of_replicas; + zend_bool randomize_replica_read_enabled; + zend_bool remove_failed_servers_enabled; + + zend_long connect_timeout; + + char *prefix; + zend_bool persistent_enabled; + + char *sasl_username; + char *sasl_password; + } session; +#endif + + struct { + char *serializer_name; + char *compression_name; + zend_long compression_threshold; + double compression_factor; + zend_long store_retry_count; + zend_long compression_level; + zend_long item_size_limit; + + /* Converted values*/ + php_memc_serializer_type serializer_type; + php_memc_compression_type compression_type; + + /* Whether we have initialised sasl for this process */ + zend_bool sasl_initialised; +
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached_server.c
Changed
(renamed from memcached-3.2.0/php_memcached_server.c)
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached_server.h
Changed
(renamed from memcached-3.2.0/php_memcached_server.h)
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached_session.c
Changed
(renamed from memcached-3.2.0/php_memcached_session.c)
View file
memcached-3.3.0.tgz/memcached-3.3.0/php_memcached_session.h
Changed
(renamed from memcached-3.2.0/php_memcached_session.h)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/001.phpt
Changed
(renamed from memcached-3.2.0/tests/001.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/add.phpt
Changed
(renamed from memcached-3.2.0/tests/add.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/append.phpt
Changed
(renamed from memcached-3.2.0/tests/append.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/bad_construct.phpt
Changed
(renamed from memcached-3.2.0/tests/bad_construct.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/bad_construct_8.phpt
Changed
(renamed from memcached-3.2.0/tests/bad_construct_8.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/bug_16084.phpt
Changed
(renamed from memcached-3.2.0/tests/bug_16084.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/bug_16959.phpt
Changed
(renamed from memcached-3.2.0/tests/bug_16959.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/bug_17137.phpt
Changed
(renamed from memcached-3.2.0/tests/bug_17137.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/bug_18639.phpt
Changed
(renamed from memcached-3.2.0/tests/bug_18639.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/cachecallback.phpt
Changed
(renamed from memcached-3.2.0/tests/cachecallback.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/callback_exception.phpt
Changed
(renamed from memcached-3.2.0/tests/callback_exception.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/callback_exception_2.phpt
Changed
(renamed from memcached-3.2.0/tests/callback_exception_2.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/cas.phpt
Changed
(renamed from memcached-3.2.0/tests/cas.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/cas_multi.phpt
Changed
(renamed from memcached-3.2.0/tests/cas_multi.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/check_if_persistent.phpt
Changed
(renamed from memcached-3.2.0/tests/check_if_persistent.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/check_if_pristine.phpt
Changed
(renamed from memcached-3.2.0/tests/check_if_pristine.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/check_key.phpt
Changed
(renamed from memcached-3.2.0/tests/check_key.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/clone.phpt
Changed
(renamed from memcached-3.2.0/tests/clone.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/compression_conditions.phpt
Added
@@ -0,0 +1,125 @@ +--TEST-- +Memcached compression test +--SKIPIF-- +<?php if (!extension_loaded("memcached")) print "skip"; ?> +--FILE-- +<?php +include dirname (__FILE__) . '/config.inc'; +$m = memc_get_instance (); + +$short_data = "abcdefg"; +$data = file_get_contents(dirname(__FILE__) . '/testdata.res'); + +set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) { + echo "$errstr\n"; + return true; +}, E_WARNING); + +function get_compression($name) { + switch (strtolower($name)) { + case 'zlib': + return Memcached::COMPRESSION_ZLIB; + case 'fastlz': + return Memcached::COMPRESSION_FASTLZ; + case 'zstd': + return Memcached::COMPRESSION_ZSTD; + default: + echo "Strange compression type: $name\n"; + return 0; + } +} + +function fetch_with_compression($m, $key, $value, $set_compression = '', $factor = 1.3, $threshold = 2000) { + ini_set("memcached.compression_factor", $factor); + ini_set("memcached.compression_threshold", $threshold); + + $len=strlen($value); + echo "len=$len set=$set_compression factor=$factor threshold=$threshold\n"; + + if (!$set_compression) { + $m->setOption(Memcached::OPT_COMPRESSION, false); + } else { + $m->setOption(Memcached::OPT_COMPRESSION, true); + $m->setOption(Memcached::OPT_COMPRESSION_TYPE, get_compression($set_compression)); + } + + $m->set($key, $value, 1800); + + $value_back = $m->get($key); + var_dump($value === $value_back); +} + +fetch_with_compression($m, 'hello01', $data, 'zlib', 1.3, 4); +fetch_with_compression($m, 'hello02', $data, 'fastlz', 1.3, 4); +fetch_with_compression($m, 'hello03', $data, '', 1.3, 4); +fetch_with_compression($m, 'hello04', $short_data, 'zlib', 1.3, 4); +fetch_with_compression($m, 'hello05', $short_data, 'fastlz', 1.3, 4); +fetch_with_compression($m, 'hello06', $short_data, '', 1.3, 4); +fetch_with_compression($m, 'hello11', $data, 'zlib', 0.3, 4); +fetch_with_compression($m, 'hello12', $data, 'fastlz', 0.3, 4); +fetch_with_compression($m, 'hello13', $data, '', 0.3, 4); +fetch_with_compression($m, 'hello14', $short_data, 'zlib', 0.3, 4); +fetch_with_compression($m, 'hello15', $short_data, 'fastlz', 0.3, 4); +fetch_with_compression($m, 'hello16', $short_data, '', 0.3, 4); +fetch_with_compression($m, 'hello21', $data, 'zlib', 1.3, 2000); +fetch_with_compression($m, 'hello22', $data, 'fastlz', 1.3, 2000); +fetch_with_compression($m, 'hello23', $data, '', 1.3, 2000); +fetch_with_compression($m, 'hello24', $short_data, 'zlib', 1.3, 2000); +fetch_with_compression($m, 'hello25', $short_data, 'fastlz', 1.3, 2000); +fetch_with_compression($m, 'hello26', $short_data, '', 1.3, 2000); +fetch_with_compression($m, 'hello31', $data, 'zlib', 0.3, 2000); +fetch_with_compression($m, 'hello32', $data, 'fastlz', 0.3, 2000); +fetch_with_compression($m, 'hello33', $data, '', 0.3, 2000); +fetch_with_compression($m, 'hello34', $short_data, 'zlib', 0.3, 2000); +fetch_with_compression($m, 'hello35', $short_data, 'fastlz', 0.3, 2000); +fetch_with_compression($m, 'hello36', $short_data, '', 0.3, 2000); +?> +--EXPECT-- +len=4877 set=zlib factor=1.3 threshold=4 +bool(true) +len=4877 set=fastlz factor=1.3 threshold=4 +bool(true) +len=4877 set= factor=1.3 threshold=4 +bool(true) +len=7 set=zlib factor=1.3 threshold=4 +bool(true) +len=7 set=fastlz factor=1.3 threshold=4 +bool(true) +len=7 set= factor=1.3 threshold=4 +bool(true) +len=4877 set=zlib factor=0.3 threshold=4 +bool(true) +len=4877 set=fastlz factor=0.3 threshold=4 +bool(true) +len=4877 set= factor=0.3 threshold=4 +bool(true) +len=7 set=zlib factor=0.3 threshold=4 +bool(true) +len=7 set=fastlz factor=0.3 threshold=4 +bool(true) +len=7 set= factor=0.3 threshold=4 +bool(true) +len=4877 set=zlib factor=1.3 threshold=2000 +bool(true) +len=4877 set=fastlz factor=1.3 threshold=2000 +bool(true) +len=4877 set= factor=1.3 threshold=2000 +bool(true) +len=7 set=zlib factor=1.3 threshold=2000 +bool(true) +len=7 set=fastlz factor=1.3 threshold=2000 +bool(true) +len=7 set= factor=1.3 threshold=2000 +bool(true) +len=4877 set=zlib factor=0.3 threshold=2000 +bool(true) +len=4877 set=fastlz factor=0.3 threshold=2000 +bool(true) +len=4877 set= factor=0.3 threshold=2000 +bool(true) +len=7 set=zlib factor=0.3 threshold=2000 +bool(true) +len=7 set=fastlz factor=0.3 threshold=2000 +bool(true) +len=7 set= factor=0.3 threshold=2000 +bool(true)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/compression_types.phpt
Added
@@ -0,0 +1,110 @@ +--TEST-- +Memcached compression test +--SKIPIF-- +<?php include "skipif.inc";?> +--FILE-- +<?php +include dirname (__FILE__) . '/config.inc'; +$m = memc_get_instance (); + +$data = file_get_contents(dirname(__FILE__) . '/testdata.res'); + +function get_compression($name) { + switch (strtolower($name)) { + case 'zlib': + return Memcached::COMPRESSION_ZLIB; + case 'fastlz': + return Memcached::COMPRESSION_FASTLZ; + case 'zstd': + if (Memcached::HAVE_ZSTD) { + return Memcached::COMPRESSION_ZSTD; + } else return 0; + default: + echo "Strange compression type: $name\n"; + return 0; + } +} + +function fetch_with_compression($m, $key, $value, $set_compression = '', $get_compression = '') { + + echo "set=$set_compression get=$get_compression\n"; + + if (!$set_compression) { + $m->setOption(Memcached::OPT_COMPRESSION, false); + } else { + $m->setOption(Memcached::OPT_COMPRESSION, true); + $m->setOption(Memcached::OPT_COMPRESSION_TYPE, get_compression($set_compression)); + } + + $m->set($key, $value, 1800); + + if (!$get_compression) { + $m->setOption(Memcached::OPT_COMPRESSION, true); + } else { + $m->setOption(Memcached::OPT_COMPRESSION, true); + $m->setOption(Memcached::OPT_COMPRESSION_TYPE, get_compression($get_compression)); + } + + $value_back = $m->get($key); + var_dump($value === $value_back); +} + +fetch_with_compression($m, 'hello1', $data, 'zlib', 'zlib'); +fetch_with_compression($m, 'hello2', $data, 'zlib', 'fastlz'); +fetch_with_compression($m, 'hello3', $data, 'fastlz', 'fastlz'); +fetch_with_compression($m, 'hello4', $data, 'fastlz', 'zlib'); +fetch_with_compression($m, 'hello5', $data, '', 'zlib'); +fetch_with_compression($m, 'hello6', $data, '', 'fastlz'); +fetch_with_compression($m, 'hello7', $data, 'zlib', ''); +fetch_with_compression($m, 'hello8', $data, 'fastlz', ''); +fetch_with_compression($m, 'hello9', $data, '', ''); +if (Memcached::HAVE_ZSTD) { +fetch_with_compression($m, 'hello10', $data, 'zstd', 'zstd'); +fetch_with_compression($m, 'hello11', $data, 'zstd', 'fastlz'); +fetch_with_compression($m, 'hello12', $data, 'fastlz', 'zstd'); +fetch_with_compression($m, 'hello13', $data, '', 'zstd'); +fetch_with_compression($m, 'hello14', $data, 'zstd', ''); +} else { + echo <<<EOB +set=zstd get=zstd +bool(true) +set=zstd get=fastlz +bool(true) +set=fastlz get=zstd +bool(true) +set= get=zstd +bool(true) +set=zstd get= +bool(true) +EOB; +} +?> +--EXPECT-- +set=zlib get=zlib +bool(true) +set=zlib get=fastlz +bool(true) +set=fastlz get=fastlz +bool(true) +set=fastlz get=zlib +bool(true) +set= get=zlib +bool(true) +set= get=fastlz +bool(true) +set=zlib get= +bool(true) +set=fastlz get= +bool(true) +set= get= +bool(true) +set=zstd get=zstd +bool(true) +set=zstd get=fastlz +bool(true) +set=fastlz get=zstd +bool(true) +set= get=zstd +bool(true) +set=zstd get= +bool(true)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/conf_persist.phpt
Changed
(renamed from memcached-3.2.0/tests/conf_persist.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/config.inc
Changed
(renamed from memcached-3.2.0/tests/config.inc)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/construct.phpt
Changed
(renamed from memcached-3.2.0/tests/construct.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/construct_persistent.phpt
Changed
(renamed from memcached-3.2.0/tests/construct_persistent.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/default_behavior.phpt
Changed
(renamed from memcached-3.2.0/tests/default_behavior.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/deleted.phpt
Changed
(renamed from memcached-3.2.0/tests/deleted.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/deletemulti.phpt
Changed
(renamed from memcached-3.2.0/tests/deletemulti.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/deletemultitypes.phpt
Changed
(renamed from memcached-3.2.0/tests/deletemultitypes.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/expire.phpt
Changed
(renamed from memcached-3.2.0/tests/expire.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/flush_buffers.phpt
Changed
(renamed from memcached-3.2.0/tests/flush_buffers.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/get_flags.phpt
Changed
(renamed from memcached-3.2.0/tests/get_flags.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/getdelayed.phpt
Changed
(renamed from memcached-3.2.0/tests/getdelayed.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/getmulti.phpt
Changed
(renamed from memcached-3.2.0/tests/getmulti.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/getserverbykey.phpt
Changed
(renamed from memcached-3.2.0/tests/getserverbykey.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/getserverlist.phpt
Changed
(renamed from memcached-3.2.0/tests/getserverlist.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/gh_155.phpt
Changed
(renamed from memcached-3.2.0/tests/gh_155.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/gh_21.phpt
Changed
(renamed from memcached-3.2.0/tests/gh_21.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/gh_500.phpt
Changed
(renamed from memcached-3.2.0/tests/gh_500.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/gh_77.phpt
Changed
(renamed from memcached-3.2.0/tests/gh_77.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/gh_90.phpt
Changed
(renamed from memcached-3.2.0/tests/gh_90.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/gh_93.phpt
Changed
(renamed from memcached-3.2.0/tests/gh_93.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/incrdecr.phpt
Changed
(renamed from memcached-3.2.0/tests/incrdecr.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/incrdecr_64.phpt
Changed
(renamed from memcached-3.2.0/tests/incrdecr_64.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/incrdecr_bykey.phpt
Changed
(renamed from memcached-3.2.0/tests/incrdecr_bykey.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/incrdecr_initial.phpt
Changed
(renamed from memcached-3.2.0/tests/incrdecr_initial.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/incrdecr_invalid_key.phpt
Changed
(renamed from memcached-3.2.0/tests/incrdecr_invalid_key.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/invalid_options.phpt
Changed
(renamed from memcached-3.2.0/tests/invalid_options.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/invoke_callback.phpt
Changed
(renamed from memcached-3.2.0/tests/invoke_callback.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/invoke_callback_2.phpt
Changed
(renamed from memcached-3.2.0/tests/invoke_callback_2.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/invoke_callback_twice.phpt
Changed
(renamed from memcached-3.2.0/tests/invoke_callback_twice.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/keys_ascii.phpt
Added
@@ -0,0 +1,187 @@ +--TEST-- +Test valid and invalid keys - ascii +--SKIPIF-- +<?php include "skipif.inc";?> +--FILE-- +<?php + +include dirname (__FILE__) . '/config.inc'; +$ascii = memc_get_instance (array ( + Memcached::OPT_BINARY_PROTOCOL => false, + Memcached::OPT_VERIFY_KEY => true + )); + +echo 'ASCII: SPACES' . PHP_EOL; +var_dump ($ascii->set ('ascii key with spaces', 'this is a test')); +var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); + +echo 'ASCII: NEWLINE' . PHP_EOL; +var_dump ($ascii->set ('asciikeywithnewline' . PHP_EOL, 'this is a test')); +var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); + +echo 'ASCII: EMPTY' . PHP_EOL; +var_dump ($ascii->set (''/*empty key*/, 'this is a test')); +var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); + +echo 'ASCII: TOO LONG' . PHP_EOL; +var_dump ($ascii->set (str_repeat ('1234567890', 512), 'this is a test')); +var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); + +echo 'ASCII: GET' . PHP_EOL; +for ($i=0;$i<32;$i++) { + var_dump ($ascii->get ('asciikeywithnonprintablechar-' . chr($i) . '-here')); + var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); +} + +echo 'ASCII: SET' . PHP_EOL; +for ($i=0;$i<32;$i++) { + var_dump ($ascii->set ('asciikeywithnonprintablechar-' . chr($i) . '-here', 'this is a test')); + var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED); +} + +echo 'OK' . PHP_EOL; + +--EXPECT-- +ASCII: SPACES +bool(false) +bool(true) +ASCII: NEWLINE +bool(false) +bool(true) +ASCII: EMPTY +bool(false) +bool(true) +ASCII: TOO LONG +bool(false) +bool(true) +ASCII: GET +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +ASCII: SET +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +OK
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/keys_binary.phpt
Changed
(renamed from memcached-3.2.0/tests/keys_binary.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/localserver.phpt
Changed
(renamed from memcached-3.2.0/tests/localserver.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/memcachedserver.phpt
Added
@@ -0,0 +1,118 @@ +--TEST-- +MemcachedServer +--SKIPIF-- +<?php +if (!extension_loaded("memcached")) { + die("skip memcached is not loaded\n"); +} +if (!class_exists("MemcachedServer")) { + die("skip memcached not built with libmemcachedprotocol support\n"); +} +if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x1001000) { + die("skip needs at least libmemcached 1.1.0\n"); +} +?> +--FILE-- +<?php +include __DIR__ . '/server.inc'; +$server = memcached_server_start(); + +$cache = new Memcached(); +$cache->setOption(Memcached::OPT_BINARY_PROTOCOL, true); +$cache->setOption(Memcached::OPT_COMPRESSION, false); +$cache->addServer('127.0.0.1', 3434); + +$cache->add("add_key", "hello", 500); +$cache->append("append_key", "world"); +$cache->prepend("prepend_key", "world"); + +$cache->increment("incr", 2, 1, 500); +$cache->decrement("decr", 2, 1, 500); + +$cache->delete("delete_k"); +$cache->flush(1); + +var_dump($cache->get('get_this')); + +$cache->set ('set_key', 'value 1', 100); +$cache->replace ('replace_key', 'value 2', 200); + +var_dump($cache->getVersion()); +var_dump($cache->getStats()); +var_dump($cache->getStats("empty")); +var_dump($cache->getStats("foobar")); +var_dump($cache->getStats("scalar")); +var_dump($cache->getStats("numeric array")); + +$cache->quit(); +usleep(50000); + +memcached_server_stop($server); +?> +Done +--EXPECTF-- +Listening on 127.0.0.1:3434 +Incoming connection from 127.0.0.1:%s +Incoming connection from 127.0.0.1:%s +client_id=%s: Add key=add_key, value=hello, flags=0, expiration=500 +client_id=%s: Append key=append_key, value=world, cas=0 +client_id=%s: Prepend key=prepend_key, value=world, cas=0 +client_id=%s: Incrementing key=incr, delta=2, initial=1, expiration=500 +client_id=%s: Decrementing key=decr, delta=2, initial=1, expiration=500 +client_id=%s: Delete key=delete_k, cas=0 +client_id=%s: Flush when=1 +client_id=%s: Get key=get_this +client_id=%s: Noop +string(20) "Hello to you client!" +client_id=%s: Set key=set_key, value=value 1, flags=0, expiration=100, cas=0 +client_id=%s: Replace key=replace_key, value=value 2, flags=0, expiration=200, cas=0 +client_id=%s: Version +array(1) { + "127.0.0.1:3434"=> + string(5) "1.1.1" +} +client_id=%s: Stat key= +array(1) { + "127.0.0.1:3434"=> + array(2) { + "key"=> + string(0) "" + "foo"=> + string(3) "bar" + } +} +client_id=%s: Stat key=empty +array(0) { +} +client_id=%s: Stat key=foobar +array(1) { + "127.0.0.1:3434"=> + array(2) { + "key"=> + string(6) "foobar" + "foo"=> + string(3) "bar" + } +} +client_id=%s: Stat key=scalar +array(1) { + "127.0.0.1:3434"=> + array(1) { + 0=> + string(%d) "you want it, you get it" + } +} +client_id=%s: Stat key=numeric array +array(1) { + "127.0.0.1:3434"=> + array(3) { + -1=> + string(3) "one" + 0=> + string(3) "two" + 1=> + string(5) "three" + } +} +client_id=%s: Client quit +Done
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/memcachedserver6.phpt
Added
@@ -0,0 +1,118 @@ +--TEST-- +MemcachedServer +--SKIPIF-- +<?php +if (!extension_loaded("memcached")) { + die("skip memcached is not loaded\n"); +} +if (!class_exists("MemcachedServer")) { + die("skip memcached not built with libmemcachedprotocol support\n"); +} +if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x1001000) { + die("skip needs at least libmemcached 1.1.0\n"); +} +?> +--FILE-- +<?php +include __DIR__ . '/server.inc'; +$server = memcached_server_start('server.php', '::1', 3434); + +$cache = new Memcached(); +$cache->setOption(Memcached::OPT_BINARY_PROTOCOL, true); +$cache->setOption(Memcached::OPT_COMPRESSION, false); +$cache->addServer('::1', 3434); + +$cache->add("add_key", "hello", 500); +$cache->append("append_key", "world"); +$cache->prepend("prepend_key", "world"); + +$cache->increment("incr", 2, 1, 500); +$cache->decrement("decr", 2, 1, 500); + +$cache->delete("delete_k"); +$cache->flush(1); + +var_dump($cache->get('get_this')); + +$cache->set ('set_key', 'value 1', 100); +$cache->replace ('replace_key', 'value 2', 200); + +var_dump($cache->getVersion()); +var_dump($cache->getStats()); +var_dump($cache->getStats("empty")); +var_dump($cache->getStats("foobar")); +var_dump($cache->getStats("scalar")); +var_dump($cache->getStats("numeric array")); + +$cache->quit(); +usleep(50000); + +memcached_server_stop($server); +?> +Done +--EXPECTF-- +Listening on ::1:3434 +Incoming connection from ::1:%s +Incoming connection from ::1:%s +client_id=%s: Add key=add_key, value=hello, flags=0, expiration=500 +client_id=%s: Append key=append_key, value=world, cas=0 +client_id=%s: Prepend key=prepend_key, value=world, cas=0 +client_id=%s: Incrementing key=incr, delta=2, initial=1, expiration=500 +client_id=%s: Decrementing key=decr, delta=2, initial=1, expiration=500 +client_id=%s: Delete key=delete_k, cas=0 +client_id=%s: Flush when=1 +client_id=%s: Get key=get_this +client_id=%s: Noop +string(20) "Hello to you client!" +client_id=%s: Set key=set_key, value=value 1, flags=0, expiration=100, cas=0 +client_id=%s: Replace key=replace_key, value=value 2, flags=0, expiration=200, cas=0 +client_id=%s: Version +array(1) { + "::1:3434"=> + string(5) "1.1.1" +} +client_id=%s: Stat key= +array(1) { + "::1:3434"=> + array(2) { + "key"=> + string(0) "" + "foo"=> + string(3) "bar" + } +} +client_id=%s: Stat key=empty +array(0) { +} +client_id=%s: Stat key=foobar +array(1) { + "::1:3434"=> + array(2) { + "key"=> + string(6) "foobar" + "foo"=> + string(3) "bar" + } +} +client_id=%s: Stat key=scalar +array(1) { + "::1:3434"=> + array(1) { + 0=> + string(%d) "you want it, you get it" + } +} +client_id=%s: Stat key=numeric array +array(1) { + "::1:3434"=> + array(3) { + -1=> + string(3) "one" + 0=> + string(3) "two" + 1=> + string(5) "three" + } +} +client_id=%s: Client quit +Done
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/multi_order.phpt
Changed
(renamed from memcached-3.2.0/tests/multi_order.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/no-not-found.phpt
Changed
(renamed from memcached-3.2.0/tests/no-not-found.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/options.phpt
Added
@@ -0,0 +1,75 @@ +--TEST-- +Memcached options +--SKIPIF-- +<?php include "skipif.inc";?> +--FILE-- +<?php +$m = new Memcached(); +$m->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_PHP); + +var_dump($m->getOption(Memcached::OPT_COMPRESSION)); +var_dump($m->getOption(Memcached::OPT_SERIALIZER)); +var_dump($m->getOption(Memcached::OPT_SOCKET_SEND_SIZE)); + +$m->setOption(Memcached::OPT_PREFIX_KEY, "\x01"); + +var_dump($m->getOption(Memcached::OPT_HASH) == Memcached::HASH_DEFAULT); +$m->setOption(Memcached::OPT_HASH, Memcached::HASH_MURMUR); +var_dump($m->getOption(Memcached::OPT_HASH) == Memcached::HASH_MURMUR); + + +$m->setOption(Memcached::OPT_COMPRESSION_TYPE, Memcached::COMPRESSION_ZLIB); +var_dump($m->getOption(Memcached::OPT_COMPRESSION_TYPE) == Memcached::COMPRESSION_ZLIB); + +$m->setOption(Memcached::OPT_COMPRESSION_TYPE, Memcached::COMPRESSION_FASTLZ); +var_dump($m->getOption(Memcached::OPT_COMPRESSION_TYPE) == Memcached::COMPRESSION_FASTLZ); + +var_dump($m->setOption(Memcached::OPT_COMPRESSION_TYPE, 0)); +var_dump($m->getOption(Memcached::OPT_COMPRESSION_TYPE) == Memcached::COMPRESSION_FASTLZ); + +echo "item_size_limit setOption\n"; +var_dump($m->setOption(Memcached::OPT_ITEM_SIZE_LIMIT, 0)); +var_dump($m->getOption(Memcached::OPT_ITEM_SIZE_LIMIT) === 0); +var_dump($m->setOption(Memcached::OPT_ITEM_SIZE_LIMIT, -1)); +var_dump($m->setOption(Memcached::OPT_ITEM_SIZE_LIMIT, 1000000)); +var_dump($m->getOption(Memcached::OPT_ITEM_SIZE_LIMIT) == 1000000); + +echo "item_size_limit ini\n"; +ini_set('memcached.item_size_limit', '0'); +$m = new Memcached(); +var_dump($m->getOption(Memcached::OPT_ITEM_SIZE_LIMIT) === 0); + +ini_set('memcached.item_size_limit', '1000000'); +$m = new Memcached(); +var_dump($m->getOption(Memcached::OPT_ITEM_SIZE_LIMIT) == 1000000); + +ini_set('memcached.item_size_limit', null); +$m = new Memcached(); +var_dump($m->getOption(Memcached::OPT_ITEM_SIZE_LIMIT) === 0); +?> +--EXPECTF-- +bool(true) +int(1) + +Warning: Memcached::getOption(): no servers defined in %s on line %d +NULL + +Warning: Memcached::setOption(): bad key provided in %s on line %d +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(true) +item_size_limit setOption +bool(true) +bool(true) + +Warning: Memcached::setOption(): ITEM_SIZE_LIMIT must be >= 0 in %s on line %d +bool(false) +bool(true) +bool(true) +item_size_limit ini +bool(true) +bool(true) +bool(true)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/pr_75.phpt
Changed
(renamed from memcached-3.2.0/tests/pr_75.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/prepend.phpt
Changed
(renamed from memcached-3.2.0/tests/prepend.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/replace.phpt
Changed
(renamed from memcached-3.2.0/tests/replace.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/rescode.phpt
Changed
(renamed from memcached-3.2.0/tests/rescode.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/reset_keyprefix.phpt
Changed
(renamed from memcached-3.2.0/tests/reset_keyprefix.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/sasl_basic.phpt
Changed
(renamed from memcached-3.2.0/tests/sasl_basic.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/server.inc
Changed
(renamed from memcached-3.2.0/tests/server.inc)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/server.php
Changed
(renamed from memcached-3.2.0/tests/server.php)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_badconf_emptyprefix.phpt
Changed
(renamed from memcached-3.2.0/tests/session_badconf_emptyprefix.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_badconf_locktime.phpt
Changed
(renamed from memcached-3.2.0/tests/session_badconf_locktime.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_badconf_persistent.phpt
Changed
(renamed from memcached-3.2.0/tests/session_badconf_persistent.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_badconf_prefix.phpt
Changed
(renamed from memcached-3.2.0/tests/session_badconf_prefix.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_badconf_servers-php72.phpt
Changed
(renamed from memcached-3.2.0/tests/session_badconf_servers-php72.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_badconf_servers.phpt
Changed
(renamed from memcached-3.2.0/tests/session_badconf_servers.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_basic.phpt
Changed
(renamed from memcached-3.2.0/tests/session_basic.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_basic2.phpt
Changed
(renamed from memcached-3.2.0/tests/session_basic2.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_basic3.phpt
Changed
(renamed from memcached-3.2.0/tests/session_basic3.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_lazy_warning.phpt
Changed
(renamed from memcached-3.2.0/tests/session_lazy_warning.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_lock-php71.phpt
Changed
(renamed from memcached-3.2.0/tests/session_lock-php71.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_lock.phpt
Changed
(renamed from memcached-3.2.0/tests/session_lock.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_persistent.phpt
Changed
(renamed from memcached-3.2.0/tests/session_persistent.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/session_regenerate.phpt
Changed
(renamed from memcached-3.2.0/tests/session_regenerate.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/set_encoding_key.phpt
Changed
(renamed from memcached-3.2.0/tests/set_encoding_key.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/set_encoding_key2.phpt
Changed
(renamed from memcached-3.2.0/tests/set_encoding_key2.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/set_large.phpt
Added
@@ -0,0 +1,19 @@ +--TEST-- +set large data +--SKIPIF-- +<?php include "skipif.inc";?> +--FILE-- +<?php +include dirname (__FILE__) . '/config.inc'; +$m = memc_get_instance (array ( + Memcached::OPT_ITEM_SIZE_LIMIT => 0, +)); + +$key = 'foobarbazDEADC0DE'; +$value = str_repeat("foo bar", 1024 * 1024); +var_dump($m->set($key, $value, 360)); +var_dump($m->get($key) === $value); +?> +--EXPECT-- +bool(true) +bool(true)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/setmulti.phpt
Changed
(renamed from memcached-3.2.0/tests/setmulti.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/setoptions.phpt
Added
@@ -0,0 +1,48 @@ +--TEST-- +Set options using setOptions +--SKIPIF-- +<?php include "skipif.inc";?> +--FILE-- +<?php +$m = new Memcached(); + +/* existing options */ +var_dump($m->setOptions(array( + Memcached::OPT_PREFIX_KEY => 'a_prefix', + Memcached::OPT_SERIALIZER => Memcached::SERIALIZER_PHP, + Memcached::OPT_COMPRESSION => 0, + Memcached::OPT_LIBKETAMA_COMPATIBLE => 1, + Memcached::OPT_CONNECT_TIMEOUT => 5000, + Memcached::OPT_ITEM_SIZE_LIMIT => 1000000, +))); + +var_dump($m->getOption(Memcached::OPT_PREFIX_KEY) == 'a_prefix'); +var_dump($m->getOption(Memcached::OPT_SERIALIZER) == Memcached::SERIALIZER_PHP); +var_dump($m->getOption(Memcached::OPT_COMPRESSION) == 0); +var_dump($m->getOption(Memcached::OPT_LIBKETAMA_COMPATIBLE) == 1); +var_dump($m->getOption(Memcached::OPT_ITEM_SIZE_LIMIT) == 1000000); + +echo "test invalid options\n"; + +var_dump($m->setOptions(array( + "asdf" => 123 +))); + +var_dump($m->setOptions(array( + -1 => 123 +))); + +--EXPECTF-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +test invalid options + +Warning: Memcached::setOptions(): invalid configuration option in %s on line %d +bool(false) + +Warning: Memcached::setOptions(): error setting memcached option: %s in %s on line %d +bool(false)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/skipif.inc
Changed
(renamed from memcached-3.2.0/tests/skipif.inc)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/stats.phpt
Changed
(renamed from memcached-3.2.0/tests/stats.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/stats_hang.phpt
Changed
(renamed from memcached-3.2.0/tests/stats_hang.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/testdata.res
Changed
(renamed from memcached-3.2.0/tests/testdata.res)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/touch_binary.phpt
Added
@@ -0,0 +1,73 @@ +--TEST-- +Touch in binary mode +--SKIPIF-- +<?php +$min_version = "1.4.8"; //TOUCH is added since 1.4.8 +include dirname(__FILE__) . "/skipif.inc"; +// The touch command in binary mode will work in libmemcached 1.0.16, but runs out the timeout clock +// See https://github.com/php-memcached-dev/php-memcached/issues/310 for further explanation +// The problem is fixed fully in libmemcached 1.0.18, so we'll focus tests on that version +if (Memcached::LIBMEMCACHED_VERSION_HEX < 0x01000018) die ('skip too old libmemcached'); +?> +--FILE-- +<?php + +function resolve_to_constant ($code) +{ + $refl = new ReflectionClass ('memcached'); + $c = $refl->getConstants (); + + foreach ($c as $name => $value) { + if (strpos ($name, 'RES_') === 0 && $value == $code) + return $name; + } +} + +function status_print ($op, $mem, $expected) +{ + $code = $mem->getResultcode(); + + if ($code == $expected) + echo "{$op} status code as expected" . PHP_EOL; + else { + $expected = resolve_to_constant ($expected); + $code = resolve_to_constant ($code); + + echo "{$op} status code mismatch, expected {$expected} but got {$code}" . PHP_EOL; + } +} + +include dirname (__FILE__) . '/config.inc'; +$mem = memc_get_instance (array (Memcached::OPT_BINARY_PROTOCOL => true)); + +$key = uniqid ('touch_t_'); + +$mem->get($key); +status_print ('get', $mem, Memcached::RES_NOTFOUND); + +$mem->set ($key, 1); +status_print ('set', $mem, Memcached::RES_SUCCESS); + +$mem->get($key); +status_print ('get', $mem, Memcached::RES_SUCCESS); + +$mem->touch ($key, 10); +status_print ('touch', $mem, Memcached::RES_SUCCESS); + +$mem->get($key); +status_print ('get', $mem, Memcached::RES_SUCCESS); + +$mem->get($key); +status_print ('get', $mem, Memcached::RES_SUCCESS); + +echo "OK\n"; + +?> +--EXPECT-- +get status code as expected +set status code as expected +get status code as expected +touch status code as expected +get status code as expected +get status code as expected +OK
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types.inc
Changed
(renamed from memcached-3.2.0/tests/types.inc)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_igbinary.phpt
Changed
(renamed from memcached-3.2.0/tests/types_igbinary.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_igbinary_multi.phpt
Changed
(renamed from memcached-3.2.0/tests/types_igbinary_multi.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_json.phpt
Changed
(renamed from memcached-3.2.0/tests/types_json.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_json_multi.phpt
Changed
(renamed from memcached-3.2.0/tests/types_json_multi.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_msgpack.phpt
Changed
(renamed from memcached-3.2.0/tests/types_msgpack.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_msgpack_multi.phpt
Changed
(renamed from memcached-3.2.0/tests/types_msgpack_multi.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_php.phpt
Changed
(renamed from memcached-3.2.0/tests/types_php.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/types_php_multi.phpt
Changed
(renamed from memcached-3.2.0/tests/types_php_multi.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/undefined_set.phpt
Changed
(renamed from memcached-3.2.0/tests/undefined_set.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/user-flags.phpt
Changed
(renamed from memcached-3.2.0/tests/user-flags.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/vbucket.phpt
Changed
(renamed from memcached-3.2.0/tests/vbucket.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/vbucket_error_7.phpt
Changed
(renamed from memcached-3.2.0/tests/vbucket_error_7.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/vbucket_error_8.phpt
Changed
(renamed from memcached-3.2.0/tests/vbucket_error_8.phpt)
View file
memcached-3.3.0.tgz/memcached-3.3.0/tests/version.phpt
Changed
(renamed from memcached-3.2.0/tests/version.phpt)
View file
memcached-3.2.0.tgz/package.xml -> memcached-3.3.0.tgz/package.xml
Changed
@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<package packagerversion="1.10.13" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> +<package packagerversion="1.10.15" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>memcached</name> <channel>pecl.php.net</channel> <summary>PHP extension for interfacing with memcached via libmemcached library</summary> @@ -28,11 +28,17 @@ <email>remi@php.net</email> <active>yes</active> </lead> - <date>2022-03-24</date> - <time>11:52:50</time> + <lead> + <name>Michael Wallner</name> + <user>mike</user> + <email>mike@php.net</email> + <active>yes</active> + </lead> + <date>2024-10-17</date> + <time>17:34:21</time> <version> - <release>3.2.0</release> - <api>3.2.0</api> + <release>3.3.0</release> + <api>3.3.0</api> </version> <stability> <release>stable</release> @@ -40,11 +46,17 @@ </stability> <license uri="http://www.php.net/license">PHP</license> <notes> -- PHP 8.0 and 8.1 support -- store_retry_count is no more set explicitly (#452) -- fix MemcachedServer (libmemcached-awesome is recommended) -- code cleanup -- fix windows build +- Add #515 option to locally enforce payload size limit +- Add #539 zstd support +- Add #540 compression_level option +- Mark password as a sensitive param for PHP 8.2 +- Upgrade Windows libmemcached to v1.1.4 +- Fix Windows PHP 8 compatibility +- Fix #518 Windows msgpack support +- Fix #522 signed integer overflow +- Fix #523 incorrect PHP reflection type for Memcached::cas $cas_token +- Fix #546 don't check key automatically, unless client-side verify_key is enabled +- Fix #555 incompatible pointer types (32-bit) </notes> <contents> <dir name="/"> @@ -63,8 +75,8 @@ <file md5sum="c209649db8e54b0b24542d4142896a52" name="tests/check_if_pristine.phpt" role="test" /> <file md5sum="3a72f2f6e1cb0ac6a1c9eccc90ee490d" name="tests/check_key.phpt" role="test" /> <file md5sum="d753b7841da68d7a3a9f0f14c601d0da" name="tests/clone.phpt" role="test" /> - <file md5sum="02b42848750f01304b8b543c9f551ab8" name="tests/compression_conditions.phpt" role="test" /> - <file md5sum="337a4a603ad6baef7ee8c622b0f278d6" name="tests/compression_types.phpt" role="test" /> + <file md5sum="042852362ed5118723080dd995e3334f" name="tests/compression_conditions.phpt" role="test" /> + <file md5sum="24c8d6a84b1ca107d21a93c81025dd93" name="tests/compression_types.phpt" role="test" /> <file md5sum="f108206906e74b243e4e9ca4cec5a62c" name="tests/conf_persist.phpt" role="test" /> <file md5sum="5f653e588dcafc00722756b35c83a539" name="tests/construct.phpt" role="test" /> <file md5sum="09480798efb9358e3b86c3df93c27b1f" name="tests/construct_persistent.phpt" role="test" /> @@ -85,7 +97,7 @@ <file md5sum="e666041d8ea0fd1b7d8b1a3136b35340" name="tests/localserver.phpt" role="test" /> <file md5sum="5b846320e91090eb202cd4a5dc307225" name="tests/multi_order.phpt" role="test" /> <file md5sum="253552a6ed8402d7fb915e11d8fa2c3c" name="tests/no-not-found.phpt" role="test" /> - <file md5sum="4e361af2d7b2475787a644e501ce0c54" name="tests/options.phpt" role="test" /> + <file md5sum="ef8f88009efdb7e5a608b51cff77f3c9" name="tests/options.phpt" role="test" /> <file md5sum="52cd927ff3e4ce93bc40c0e92a06878b" name="tests/pr_75.phpt" role="test" /> <file md5sum="9b182457d9aa8f5a4c0a11c9a5fd437f" name="tests/rescode.phpt" role="test" /> <file md5sum="f7087831c069974dea58fdcd418d0588" name="tests/session_badconf_emptyprefix.phpt" role="test" /> @@ -98,9 +110,9 @@ <file md5sum="aa156bf7bb4462e9173317c7e6daaeac" name="tests/session_basic2.phpt" role="test" /> <file md5sum="515c05e73a3d1bb4e3ed6e58d256b8c4" name="tests/session_basic3.phpt" role="test" /> <file md5sum="e97c28a1b11a7a513eadc4560db17780" name="tests/session_persistent.phpt" role="test" /> - <file md5sum="c7030c53a0a4a70db0eb9f4931b20efd" name="tests/set_large.phpt" role="test" /> - <file md5sum="bc001a6bdfc8535411aa509d9d40e95c" name="tests/setoptions.phpt" role="test" /> - <file md5sum="5096ca152b3344f8dab6a2182c98ace0" name="tests/touch_binary.phpt" role="test" /> + <file md5sum="a3b1bfa74587ee190efb82a989f06e4a" name="tests/set_large.phpt" role="test" /> + <file md5sum="805d702bc6f370be159337cc62cb84f6" name="tests/setoptions.phpt" role="test" /> + <file md5sum="9f9da1ab15aa1e68eca2d9654474b9f1" name="tests/touch_binary.phpt" role="test" /> <file md5sum="977a8c648fefbfdd0281146b99566046" name="tests/types.inc" role="test" /> <file md5sum="2efee38de0a9ac21aa08195d2f028e66" name="tests/types_igbinary.phpt" role="test" /> <file md5sum="eb026f27e4bf6341c7a113bceca0124c" name="tests/types_igbinary_multi.phpt" role="test" /> @@ -131,7 +143,7 @@ <file md5sum="8a4542d8276de516ec4624092d4b9a46" name="tests/incrdecr_invalid_key.phpt" role="test" /> <file md5sum="87a62cc497a6b660a4a01d0cbf02ba35" name="tests/incrdecr_bykey.phpt" role="test" /> <file md5sum="3925fe82126261b6589bd9cbf64a4568" name="tests/invalid_options.phpt" role="test" /> - <file md5sum="3d4e8dc5099592914cbcd273efc93d6c" name="tests/keys_ascii.phpt" role="test" /> + <file md5sum="16e38964cf1c1cc0ca2f4d5d769ef41a" name="tests/keys_ascii.phpt" role="test" /> <file md5sum="5c51cc2837948891fb0c6e4c63a2e669" name="tests/keys_binary.phpt" role="test" /> <file md5sum="a4058bd7f5993894fb867bafa57097c8" name="tests/testdata.res" role="test" /> <file md5sum="cb4b22ed0a91765f3be48e66b28118c9" name="tests/config.inc" role="test" /> @@ -151,23 +163,23 @@ <file md5sum="91401c7726d8fe32d303a472807f613c" name="tests/session_lock-php71.phpt" role="test" /> <file md5sum="a4344764c217a1ebcc38c76a85e5697d" name="tests/server.inc" role="test" /> <file md5sum="b03cb654128034ac234cc2132136081a" name="tests/server.php" role="test" /> - <file md5sum="15b9597828a5e71c904f5d63b915217b" name="tests/memcachedserver.phpt" role="test" /> - <file md5sum="83f16fd1ad3eb242330a599e45fb08a1" name="tests/memcachedserver6.phpt" role="test" /> - <file md5sum="e363615c309e1ca265a16bee4b396540" name="README.markdown" role="doc" /> + <file md5sum="e2277d14ca5ddef28317876772e16c29" name="tests/memcachedserver.phpt" role="test" /> + <file md5sum="d90e26ff58c4e73518083bf9d2186f77" name="tests/memcachedserver6.phpt" role="test" /> + <file md5sum="0bd2f010d5ae171e59cff0bb7ff89650" name="README.markdown" role="doc" /> <file md5sum="f15b54956edc11e9bf1c995385b433b4" name="CREDITS" role="doc" /> <file md5sum="cb564efdf78cce8ea6e4b5a4f7c05d97" name="LICENSE" role="doc" /> <file md5sum="19715df9170f028156b4457cb2552050" name="ChangeLog" role="doc" /> <file md5sum="aa4e3e907461b5ddb6dcd3a133dc393a" name="memcached-api.php" role="doc" /> - <file md5sum="cde6e7130e5b0b245dd396b1bfdd63dd" name="memcached.ini" role="doc" /> + <file md5sum="2ca8bb4739270ec832a2ee548cae54e4" name="memcached.ini" role="doc" /> <file md5sum="543b3b1b8571c4b9c02eafee4a6f3fa3" name="fastlz/LICENSE" role="doc" /> - <file md5sum="0f4f06353dc6831885e311b38d546a86" name="config.m4" role="src" /> - <file md5sum="99852c597ceafb5429057b1e17bf7826" name="config.w32" role="src" /> - <file md5sum="dbdaadc461126eaa9e69db72337d8afa" name="php_memcached.c" role="src" /> - <file md5sum="0ff5c00ae1778b997a25bdfd572895d9" name="php_memcached.h" role="src" /> - <file md5sum="dda2cf88fd462f452940e95f06609e78" name="php_memcached.stub.php" role="src" /> - <file md5sum="760d9041d472520c09a6bcd4ce9ffab9" name="php_memcached_arginfo.h" role="src" /> - <file md5sum="b03c1b12fdac77821097e2b7e3f11be1" name="php_memcached_legacy_arginfo.h" role="src" /> - <file md5sum="ab8183a753b3291c30adf11872507652" name="php_memcached_private.h" role="src" /> + <file md5sum="46c9d6eb5b0aa98b661f01713c83b9f7" name="config.m4" role="src" /> + <file md5sum="213ab2f62bd432a52bca3613e1384289" name="config.w32" role="src" /> + <file md5sum="18116fc48d0be39dd7b4dce5f3e3e9d7" name="php_memcached.c" role="src" /> + <file md5sum="1a782697d4c8e9a9e2a1392333af8700" name="php_memcached.h" role="src" /> + <file md5sum="8fdd66e2834d0ae00e20158b00094b55" name="php_memcached.stub.php" role="src" /> + <file md5sum="124f4c1f771dafb0f8bed5630132807d" name="php_memcached_arginfo.h" role="src" /> + <file md5sum="b7769fd4a3958cdf41903f2002363c52" name="php_memcached_legacy_arginfo.h" role="src" /> + <file md5sum="6e26be8c7c8caba57ae48331615284cd" name="php_memcached_private.h" role="src" /> <file md5sum="b1ecb6f476a9394e896f4a00db4a18d7" name="php_memcached_session.c" role="src" /> <file md5sum="3c47c0ddad806318e44c4a0307179532" name="php_memcached_session.h" role="src" /> <file md5sum="fdfd0d785240591e81437a91e5c341e3" name="php_libmemcached_compat.h" role="src" /> @@ -214,6 +226,25 @@ </extsrcrelease> <changelog> <release> + <date>2022-03-24</date> + <version> + <release>3.2.0</release> + <api>3.2.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.php.net/license">PHP</license> + <notes> +- PHP 8.0 and 8.1 support +- store_retry_count is no more set explicitly (#452) +- fix MemcachedServer (libmemcached-awesome is recommended) +- code cleanup +- fix windows build + </notes> + </release> + <release> <date>2019-12-03</date> <version> <release>3.1.5</release>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.