Skip to content

Instantly share code, notes, and snippets.

@stealth35
Created June 15, 2012 09:57
Show Gist options
  • Save stealth35/2935694 to your computer and use it in GitHub Desktop.
Save stealth35/2935694 to your computer and use it in GitHub Desktop.
PHP get_current_aliases
static int copy_current_alias_name(zval **ns TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *array = va_arg(args, zval *);
add_next_index_stringl(array, hash_key->arKey, hash_key->nKeyLength, 1);
return ZEND_HASH_APPLY_KEEP;
}
PHP_FUNCTION(get_current_aliases)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
array_init(return_value);
zend_hash_apply_with_arguments(CG(current_import) TSRMLS_CC, (apply_func_args_t) copy_current_alias_name, 1, return_value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment