Exemplo n.º 1
0
/* {{{ mysqlnd_res_meta::func_leave */
static enum_func_status
MYSQLND_METHOD(mysqlnd_debug, func_leave)(MYSQLND_DEBUG * self, unsigned int line,
										  const char * const file)
{
	char *func_name;
#ifdef MYSQLND_THREADED
	MYSQLND_ZTS(self);
#endif
	if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) {
		return PASS;
	}
#ifdef MYSQLND_THREADED
	if (MYSQLND_G(thread_id) != tsrm_thread_id()) {
		return PASS; /* don't trace background threads */
	}
#endif
	if (zend_stack_count(&self->call_stack) >= self->nest_level_limit) {
		return PASS;
	}

	zend_stack_top(&self->call_stack, (void **)&func_name);

	if (func_name[0] == '\0') {
		; /* don't log that function */
	} else if (!zend_hash_num_elements(&self->not_filtered_functions) ||
		1 == zend_hash_exists(&self->not_filtered_functions, func_name, strlen(func_name) + 1))
	{
		self->m->log_va(self, line, file, zend_stack_count(&self->call_stack) - 1, NULL, "<%s", func_name);
	}

	return zend_stack_del_top(&self->call_stack) == SUCCESS? PASS:FAIL;
}
Exemplo n.º 2
0
ZEND_API int zend_stack_int_top(const zend_stack *stack)
{
	int *e = zend_stack_top(stack);
	if (e) {
		return *e;
	} else {
		return FAILURE;
	}
}
Exemplo n.º 3
0
ZEND_API int zend_stack_int_top(const zend_stack *stack)
{
	int *e;

	if (zend_stack_top(stack, (void **) &e) == FAILURE) {
		return FAILURE;			/* this must be a negative number, since negative numbers can't be address numbers */
	} else {
		return *e;
	}
}
Exemplo n.º 4
0
/* {{{ void php_output_deactivate(TSRMLS_D)
 * Destroy the output handler stack */
PHPAPI void php_output_deactivate(TSRMLS_D)
{
	php_output_handler **handler = NULL;

	OG(active) = NULL;
	OG(running) = NULL;

	/* release all output handlers */
	if (OG(handlers).elements) {
		while (SUCCESS == zend_stack_top(&OG(handlers), (void *) &handler)) {
			php_output_handler_free(handler TSRMLS_CC);
			zend_stack_del_top(&OG(handlers));
		}
		zend_stack_destroy(&OG(handlers));
	}
}