Skip to content

Commit ae24f49

Browse files
committedOct 17, 2013
Added flush buffers and a test case, #78
1 parent e68aa8c commit ae24f49

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎php_memcached.c

+21
Original file line numberDiff line numberDiff line change
@@ -2006,6 +2006,22 @@ PHP_METHOD(Memcached, quit)
20062006
}
20072007
/* }}} */
20082008

2009+
/* {{{ Memcached::flushBuffers()
2010+
Flush and senf buffered commands */
2011+
PHP_METHOD(Memcached, flushBuffers)
2012+
{
2013+
memcached_return rc;
2014+
MEMC_METHOD_INIT_VARS;
2015+
2016+
if (zend_parse_parameters_none() == FAILURE) {
2017+
return;
2018+
}
2019+
2020+
MEMC_METHOD_FETCH_OBJECT;
2021+
RETURN_BOOL(memcached_flush_buffers(m_obj->memc) == MEMCACHED_SUCCESS);
2022+
}
2023+
/* }}} */
2024+
20092025
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x00049000
20102026
/* {{{ Memcached::getLastErrorMessage()
20112027
Returns the last error message that occurred */
@@ -3547,6 +3563,9 @@ ZEND_END_ARG_INFO()
35473563
ZEND_BEGIN_ARG_INFO(arginfo_quit, 0)
35483564
ZEND_END_ARG_INFO()
35493565

3566+
ZEND_BEGIN_ARG_INFO(arginfo_flushBuffers, 0)
3567+
ZEND_END_ARG_INFO()
3568+
35503569
ZEND_BEGIN_ARG_INFO(arginfo_getServerByKey, 0)
35513570
ZEND_ARG_INFO(0, server_key)
35523571
ZEND_END_ARG_INFO()
@@ -3649,6 +3668,8 @@ static zend_function_entry memcached_class_methods[] = {
36493668
MEMC_ME(getServerByKey, arginfo_getServerByKey)
36503669
MEMC_ME(resetServerList, arginfo_resetServerList)
36513670
MEMC_ME(quit, arginfo_quit)
3671+
MEMC_ME(flushBuffers, arginfo_flushBuffers)
3672+
36523673

36533674
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x00049000
36543675
MEMC_ME(getLastErrorMessage, arginfo_getLastErrorMessage)

0 commit comments

Comments
 (0)
Please sign in to comment.