Skip to content

Add optional parameter 'type' for method 'getStats' #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion memcached-api.php
Original file line number Diff line number Diff line change
@@ -275,7 +275,7 @@ public function getLastDisconnectedServer( ) {}

public function flush( $delay = 0 ) {}

public function getStats( ) {}
public function getStats( $type = null ) {}

public function getVersion( ) {}

10 changes: 8 additions & 2 deletions php_memcached.c
Original file line number Diff line number Diff line change
@@ -2645,16 +2645,21 @@ memcached_return s_stat_execute_cb (php_memcached_instance_st instance, const ch
PHP_METHOD(Memcached, getStats)
{
memcached_return status;
char *args = NULL;
zend_string *args_string = NULL;
MEMC_METHOD_INIT_VARS;

if (zend_parse_parameters_none() == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S!", &args_string) == FAILURE) {
return;
}

MEMC_METHOD_FETCH_OBJECT;

if (args_string)
args = ZSTR_VAL(args_string);

array_init(return_value);
status = memcached_stat_execute(intern->memc, NULL, s_stat_execute_cb, return_value);
status = memcached_stat_execute(intern->memc, args, s_stat_execute_cb, return_value);
if (s_memc_status_handle_result_code(intern, status) == FAILURE) {
zval_ptr_dtor(return_value);
RETURN_FALSE;
@@ -3927,6 +3932,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_setBucket, 3)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_getStats, 0)
ZEND_ARG_INFO(0, args)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_getVersion, 0)