Skip to content
Merged
Show file tree
Hide file tree
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
Expand Up @@ -275,7 +275,7 @@ public function getLastDisconnectedServer( ) {}

public function flush( $delay = 0 ) {}

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

public function getVersion( ) {}

Expand Down
10 changes: 8 additions & 2 deletions php_memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down