Skip to content

Commit

Permalink
fix #34
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Aug 13, 2013
1 parent 5a572f1 commit a34c284
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion php_apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,30 @@ PHP_FUNCTION(apcu_clear_cache)
RETURN_TRUE;
}
/* }}} */

/* {{{ proto array apc_cache_info(string cache_type, [bool limited]) */
PHP_FUNCTION(apcu_cache_info)
{
zval* info;
zend_bool limited = 0;
char *ct;
ulong ctlen;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &cache_type, &ctlen, &limited) == FAILURE) {
return;
}

info = apc_cache_info(apc_user_cache, limited TSRMLS_CC);

if (!info) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file");
RETURN_FALSE;
}

RETURN_ZVAL(info, 0, 1);

}
/* }}} */
#else
/* {{{ proto void apc_clear_cache() */
PHP_FUNCTION(apcu_clear_cache)
Expand All @@ -450,7 +474,6 @@ PHP_FUNCTION(apcu_clear_cache)
RETURN_TRUE;
}
/* }}} */
#endif

/* {{{ proto array apc_cache_info([bool limited]) */
PHP_FUNCTION(apcu_cache_info)
Expand All @@ -473,6 +496,7 @@ PHP_FUNCTION(apcu_cache_info)

}
/* }}} */
#endif

/* {{{ proto array apc_sma_info([bool limited]) */
PHP_FUNCTION(apcu_sma_info)
Expand Down

0 comments on commit a34c284

Please sign in to comment.