Added ini setting for memcached.store_retry_count

This commit is contained in:
Nicolas Van Eenaeme
2013-11-15 15:04:49 +01:00
parent 1cbaeefc83
commit 761fc79381
3 changed files with 10 additions and 1 deletions

View File

@@ -109,3 +109,9 @@ memcached.serializer = "igbinary"
; the default is Off
memcached.use_sasl = Off
; 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 2
memcached.store_retry_count = 2

View File

@@ -317,6 +317,7 @@ PHP_INI_BEGIN()
#if HAVE_MEMCACHED_SASL
STD_PHP_INI_ENTRY("memcached.use_sasl", "0", PHP_INI_SYSTEM, OnUpdateBool, use_sasl, zend_php_memcached_globals, php_memcached_globals)
#endif
STD_PHP_INI_ENTRY("memcached.store_retry_count", "2", PHP_INI_ALL, OnUpdateLong, store_retry_count, zend_php_memcached_globals, php_memcached_globals)
PHP_INI_END()
/* }}} */
@@ -467,7 +468,7 @@ static PHP_METHOD(Memcached, __construct)
m_obj->serializer = MEMC_G(serializer);
m_obj->compression_type = MEMC_G(compression_type_real);
m_obj->compression = 1;
m_obj->store_retry_count = 2;
m_obj->store_retry_count = MEMC_G(store_retry_count);
i_obj->obj = m_obj;
i_obj->is_pristine = 1;
@@ -3201,6 +3202,7 @@ static void php_memc_init_globals(zend_php_memcached_globals *php_memcached_glob
#if HAVE_MEMCACHED_SASL
MEMC_G(use_sasl) = 0;
#endif
MEMC_G(store_retry_count) = 2;
}
static void php_memc_destroy_globals(zend_php_memcached_globals *php_memcached_globals_p TSRMLS_DC)

View File

@@ -93,6 +93,7 @@ ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
#if HAVE_MEMCACHED_SASL
bool use_sasl;
#endif
int store_retry_count;
ZEND_END_MODULE_GLOBALS(php_memcached)
PHP_MEMCACHED_API zend_class_entry *php_memc_get_ce(void);