Package: php5-memcached Version: 2.1.0-1 Severity: normal -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Dear Maintainer, due to an API break in libmemcached 1.0.9 php-memcached does no longer build: /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:318:82: error: unknown type name 'memcached_server_instance_st' /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:319:77: error: unknown type name 'memcached_server_instance_st' /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:320:79: error: unknown type name 'memcached_server_instance_st' /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:1948:17: error: 'php_memc_do_serverlist_callback' undeclared (first use in this function) /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:2056:17: error: 'php_memc_do_stats_callback' undeclared (first use in this function) /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:2089:17: error: 'php_memc_do_version_callback' undeclared (first use in this function) /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:2576:82: error: unknown type name 'memcached_server_instance_st' /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:2593:77: error: unknown type name 'memcached_server_instance_st' /tmp/buildd/php-memcached-2.1.0/memcached-2.1.0/php_memcached.c:2637:79: error: unknown type name 'memcached_server_instance_st' Upstream has already a bugreport for this: https://github.com/php-memcached-dev/php-memcached/pull/80 There is already a package for libmemcached-1.0.17-1 in experimental. To ease the transition into unstable I've attached a patch to fix those errors. - -- System Information: Debian Release: jessie/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.11-trunk-amd64 (SMP w/1 CPU core) Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQIcBAEBAgAGBQJSQwWaAAoJEGlMre9Rx7W2JroP/2K82HSrBIiZWSq5haaPn+Lq TlqJsMmldmX1HW44+Wn7Az1j3dtedvYoghcJBMy82/a6JZ627+KJ+niUX0c1JRAn JIyDFw8LdcWxhmmXxAfvYJjIp96qQUuckhoaeTh/RvCti4FM7VxsKsmyddzdqhPo 4KZYcwecBaOyRbn7M6OwkfDj/EBTGXUoiPnAubopucBk3IGgmepY8FSBxq+veJth zeLqIcIvJOTwKLefyxUP/I+89oTYpVvgl+T1/Z6tOIWXNJ69C7xTDkQVfTfHyPnc XiVX0m653nozEOqib3V6CWSR/Ww03ZMNkcnSUz9FWBQTIFia19d/wsH3B5JbtIIl dNnDo/wrBn1nQ6wS2XvZXqbfiRwO+ZVbiGLdgXrytY9/1rWSUxMAvo6JRi1ObGhA +AF4NnQGjCH6eqWfN0PDc0mDrYLZV54JoHDYDw6HoUve8AcE1VwR2GjyybHpaIaJ GCQToffipPZSrZxECw65UraTMb6XKIuJHUekLAjxIFptqVdz01DETRjmrXF8aWbg ZrANx3ELj70QNyFXqC4U9s2yMZeV714+HZDdzgpWzePgEMWKb62Mxq1y3NRQoXaF k5MuDCkLkVrRhCWWSP0yEbfMUaF0exT4nVMrOaiMXrTRiKm3BiwkutbMl5daKwCR 72s+JflCoL9Nke6evG0T =TNEy -----END PGP SIGNATURE-----
Description: Adapt to libmemcached API >= 1.0.9 libmemcached introduces an API break with 1.0.9 by renaming structs and introducting accessor functions. This patch adds preprocessor conditionals to used the different APIs depending on the version of libmemcached. This patch is based on the pull-request from Faidon Liambotis (paravoid). Author: Michael Fladischer <fladischermich...@fladi.at> Last-Update: 2013-09-25 Bug: https://github.com/php-memcached-dev/php-memcached/pull/80 --- a/memcached-2.1.0/php_memcached.c +++ b/memcached-2.1.0/php_memcached.c @@ -315,9 +315,15 @@ static void php_memc_getDelayed_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key); static memcached_return php_memc_do_cache_callback(zval *memc_obj, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char *key, size_t key_len, zval *value TSRMLS_DC); static int php_memc_do_result_callback(zval *memc_obj, zend_fcall_info *fci, zend_fcall_info_cache *fcc, memcached_result_st *result TSRMLS_DC); +#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009 +static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context); +static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context); +static memcached_return php_memc_do_version_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context); +#else static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context); static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context); static memcached_return php_memc_do_version_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context); +#endif static void php_memc_destroy(struct memc_obj *m_obj, zend_bool persistent TSRMLS_DC); /**************************************** @@ -1855,7 +1861,7 @@ zval **z_host, **z_port, **z_weight = NULL; uint32_t weight = 0; int entry_size, i = 0; - memcached_server_st *list = NULL; + memcached_server_list_st list = NULL; memcached_return status; MEMC_METHOD_INIT_VARS; @@ -1958,7 +1964,11 @@ { char *server_key; int server_key_len; - memcached_server_st *server; +#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009 + const memcached_instance_st *server; +#else + memcached_server_instance_st *server; +#endif memcached_return error; MEMC_METHOD_INIT_VARS; @@ -1981,9 +1991,14 @@ } array_init(return_value); +#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009 + add_assoc_string(return_value, "host", memcached_server_port(server), 1); + add_assoc_long(return_value, "port", memcached_server_port(server)); +#else add_assoc_string(return_value, "host", server->hostname, 1); add_assoc_long(return_value, "port", server->port); add_assoc_long(return_value, "weight", server->weight); +#endif } /* }}} */ @@ -2573,7 +2588,11 @@ /* }}} */ /* {{{ internal API functions */ +#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009 +static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context) +#else static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context) +#endif { struct callbackContext* context = (struct callbackContext*) in_context; zval *array; @@ -2590,7 +2609,11 @@ return MEMCACHED_SUCCESS; } +#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009 +static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context) +#else static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context) +#endif { char *hostport = NULL; int hostport_len; @@ -2634,7 +2657,11 @@ return MEMCACHED_SUCCESS; } +#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009 +static memcached_return php_memc_do_version_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context) +#else static memcached_return php_memc_do_version_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context) +#endif { char *hostport = NULL; char version[16];