mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
implemented dba_handlers()
@Added dba_handlers() that lists all installed handlers in an array. (marcus)
This commit is contained in:
parent
0e28eaf550
commit
82b96d99f3
@ -51,6 +51,7 @@ function_entry dba_functions[] = {
|
||||
PHP_FE(dba_nextkey, NULL)
|
||||
PHP_FE(dba_optimize, NULL)
|
||||
PHP_FE(dba_sync, NULL)
|
||||
PHP_FE(dba_handlers, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
/* }}} */
|
||||
@ -512,6 +513,27 @@ PHP_FUNCTION(dba_sync)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array dba_list()
|
||||
List configured databases */
|
||||
PHP_FUNCTION(dba_handlers)
|
||||
{
|
||||
dba_handler *hptr;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=0) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
for(hptr = handler; hptr->name; hptr++) {
|
||||
add_next_index_string(return_value, hptr->name, 1);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -94,6 +94,7 @@ PHP_FUNCTION(dba_exists);
|
||||
PHP_FUNCTION(dba_fetch);
|
||||
PHP_FUNCTION(dba_optimize);
|
||||
PHP_FUNCTION(dba_sync);
|
||||
PHP_FUNCTION(dba_handlers);
|
||||
|
||||
#else
|
||||
#define dba_module_ptr NULL
|
||||
|
Loading…
Reference in New Issue
Block a user