当前位置: 首页>>代码示例>>C++>>正文


C++ zend_hash_get_current_data_ex函数代码示例

本文整理汇总了C++中zend_hash_get_current_data_ex函数的典型用法代码示例。如果您正苦于以下问题:C++ zend_hash_get_current_data_ex函数的具体用法?C++ zend_hash_get_current_data_ex怎么用?C++ zend_hash_get_current_data_ex使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了zend_hash_get_current_data_ex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PHP_METHOD

PHP_METHOD(Test_Flow, testFor24) {

	HashTable *_3;
	HashPosition _2;
	zval *_0;
	zval *b;
	zval *a = NULL, *_1, **_4;

	ZEPHIR_MM_GROW();

	ZEPHIR_INIT_VAR(b);
	ZVAL_EMPTY_STRING(b);
	ZEPHIR_INIT_VAR(_0);
	array_init_size(_0, 6);
	ZEPHIR_INIT_VAR(_1);
	ZVAL_LONG(_1, 'a');
	zephir_array_fast_append(_0, _1);
	ZEPHIR_INIT_BNVAR(_1);
	ZVAL_LONG(_1, 'b');
	zephir_array_fast_append(_0, _1);
	ZEPHIR_INIT_BNVAR(_1);
	ZVAL_LONG(_1, 'c');
	zephir_array_fast_append(_0, _1);
	ZEPHIR_INIT_BNVAR(_1);
	ZVAL_LONG(_1, 'd');
	zephir_array_fast_append(_0, _1);
	zephir_is_iterable(_0, &_3, &_2, 0, 0);
	for (
		; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS
		; zend_hash_move_forward_ex(_3, &_2)
	) {
		ZEPHIR_GET_HVALUE(a, _4);
		zephir_concat_self(&b, a TSRMLS_CC);
	}
	RETURN_CTOR(b);

}
开发者ID:hobbit19,项目名称:zephir,代码行数:37,代码来源:flow.c

示例2: MAKE_STD_ZVAL

static zval *phannot_ret_zval_list(zval *list_left, zval *right_list)
{

	zval *ret;
	HashPosition pos;
	HashTable *list;

	MAKE_STD_ZVAL(ret);
	array_init(ret);

	if (list_left) {

		list = Z_ARRVAL_P(list_left);
		if (zend_hash_index_exists(list, 0)) {
			zend_hash_internal_pointer_reset_ex(list, &pos);
			for (;; zend_hash_move_forward_ex(list, &pos)) {

				zval ** item;

				if (zend_hash_get_current_data_ex(list, (void**) &item, &pos) == FAILURE) {
					break;
				}

				Z_ADDREF_PP(item);
				add_next_index_zval(ret, *item);

			}
			zval_ptr_dtor(&list_left);
		} else {
			add_next_index_zval(ret, list_left);
		}
	}

	add_next_index_zval(ret, right_list);

	return ret;
}
开发者ID:Diego-Brocanelli,项目名称:cphalcon,代码行数:37,代码来源:parser.c

示例3: PHP_METHOD

/**
 * Restore a \Phalcon\Http\Response\Headers object
 */
PHP_METHOD(Phalcon_Http_Response_Headers, __set_state) {

	HashTable *_1$$3;
	HashPosition _0$$3;
	zephir_fcall_cache_entry *_3 = NULL;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *data_param = NULL, *headers = NULL, *key = NULL, *value = NULL, *dataHeaders = NULL, **_2$$3;
	zval *data = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &data_param);

	data = data_param;


	ZEPHIR_INIT_VAR(headers);
	object_init_ex(headers, phalcon_http_response_headers_ce);
	if (zephir_has_constructor(headers TSRMLS_CC)) {
		ZEPHIR_CALL_METHOD(NULL, headers, "__construct", NULL, 0);
		zephir_check_call_status();
	}
	ZEPHIR_OBS_VAR(dataHeaders);
	if (zephir_array_isset_string_fetch(&dataHeaders, data, SS("_headers"), 0 TSRMLS_CC)) {
		zephir_is_iterable(dataHeaders, &_1$$3, &_0$$3, 0, 0, "phalcon/http/response/headers.zep", 126);
		for (
		  ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS
		  ; zend_hash_move_forward_ex(_1$$3, &_0$$3)
		) {
			ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3);
			ZEPHIR_GET_HVALUE(value, _2$$3);
			ZEPHIR_CALL_METHOD(NULL, headers, "set", &_3, 258, key, value);
			zephir_check_call_status();
		}
	}
	RETURN_CCTOR(headers);

}
开发者ID:adam-rocska,项目名称:cphalcon,代码行数:40,代码来源:headers.zep.c

示例4: PHP_METHOD

/**
 * Sets the path for a domain
 *
 * <code>
 * // Set the directory path
 * $gettext->setDirectory("/path/to/the/messages");
 *
 * // Set the domains and directories path
 * $gettext->setDirectory(
 *     [
 *         "messages" => "/path/to/the/messages",
 *         "another"  => "/path/to/the/another",
 *     ]
 * );
 * </code>
 *
 * @param string|array directory The directory path or an array of directories and domains
 */
PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory) {

	HashTable *_1$$4;
	HashPosition _0$$4;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zephir_fcall_cache_entry *_3 = NULL;
	zval *directory, *key = NULL, *value = NULL, **_2$$4, *_4$$6 = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &directory);



	if (ZEPHIR_IS_EMPTY(directory)) {
		RETURN_MM_NULL();
	}
	zephir_update_property_this(getThis(), SL("_directory"), directory TSRMLS_CC);
	if (Z_TYPE_P(directory) == IS_ARRAY) {
		zephir_is_iterable(directory, &_1$$4, &_0$$4, 0, 0, "phalcon/translate/adapter/gettext.zep", 180);
		for (
		  ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS
		  ; zend_hash_move_forward_ex(_1$$4, &_0$$4)
		) {
			ZEPHIR_GET_HMKEY(key, _1$$4, _0$$4);
			ZEPHIR_GET_HVALUE(value, _2$$4);
			ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_3, 473, key, value);
			zephir_check_call_status();
		}
	} else {
		ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getdefaultdomain", NULL, 0);
		zephir_check_call_status();
		ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_3, 473, _4$$6, directory);
		zephir_check_call_status();
	}
	ZEPHIR_MM_RESTORE();

}
开发者ID:luomor,项目名称:cphalcon,代码行数:55,代码来源:gettext.zep.c

示例5: PHP_METHOD

/**
 * Check if HTTP method match any of the passed methods
 *
 * @param string|array $methods
 * @return boolean
 */
PHP_METHOD(Phalcon_Http_Request, isMethod){

	zval *methods, *http_method, *is_equals, *method = NULL;
	HashTable *ah0;
	HashPosition hp0;
	zval **hd;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &methods);
	
	PHALCON_INIT_VAR(http_method);
	phalcon_call_method(http_method, this_ptr, "getmethod");

	if (Z_TYPE_P(methods) == IS_STRING) {
		PHALCON_INIT_VAR(is_equals);
		is_equal_function(is_equals, methods, http_method TSRMLS_CC);
		RETURN_NCTOR(is_equals);
	} else {
	
		phalcon_is_iterable(methods, &ah0, &hp0, 0, 0);
	
		while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
	
			PHALCON_GET_HVALUE(method);
	
			if (PHALCON_IS_EQUAL(method, http_method)) {
				RETURN_MM_TRUE;
			}
	
			zend_hash_move_forward_ex(ah0, &hp0);
		}
	
	}
	
	RETURN_MM_FALSE;
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:43,代码来源:request.c

示例6: PHP_METHOD

PHP_METHOD(Test_Flow, testFor2) {

	HashTable *_2;
	HashPosition _1;
	double c;
	zval *v = NULL, *k = NULL, *b, *_0, **_3;

	ZEPHIR_MM_GROW();

	c = (double) (0);
	ZEPHIR_INIT_VAR(b);
	array_init_size(b, 5);
	ZEPHIR_INIT_VAR(_0);
	ZVAL_LONG(_0, 1);
	zephir_array_fast_append(b, _0);
	ZEPHIR_INIT_BNVAR(_0);
	ZVAL_LONG(_0, 2);
	zephir_array_fast_append(b, _0);
	ZEPHIR_INIT_BNVAR(_0);
	ZVAL_LONG(_0, 3);
	zephir_array_fast_append(b, _0);
	ZEPHIR_INIT_BNVAR(_0);
	ZVAL_LONG(_0, 4);
	zephir_array_fast_append(b, _0);
	zephir_is_iterable(b, &_2, &_1, 0, 0);
	for (
		; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
		; zend_hash_move_forward_ex(_2, &_1)
	) {
		ZEPHIR_GET_HMKEY(k, _2, _1);
		ZEPHIR_GET_HVALUE(v, _3);
		c += zephir_get_numberval(k);
	}
	RETURN_MM_DOUBLE(c);

}
开发者ID:azrulharis,项目名称:zephir,代码行数:36,代码来源:flow.c

示例7: PHP_METHOD

/**
 * Returns the paths using positions as keys and names as values
 *
 * @return array
 */
PHP_METHOD(Test_Router_Route, getReversedPaths) {

	HashTable *_2;
	HashPosition _1;
	zval *reversed, *path = NULL, *position = NULL, *_0, **_3;

	ZEPHIR_MM_GROW();

	ZEPHIR_INIT_VAR(reversed);
	array_init(reversed);
	ZEPHIR_OBS_VAR(_0);
	zephir_read_property_this(&_0, this_ptr, SL("_paths"), PH_NOISY_CC);
	zephir_is_iterable(_0, &_2, &_1, 0, 0);
	for (
		; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
		; zend_hash_move_forward_ex(_2, &_1)
	) {
		ZEPHIR_GET_HMKEY(path, _2, _1);
		ZEPHIR_GET_HVALUE(position, _3);
		zephir_array_update_zval(&reversed, position, &path, PH_COPY | PH_SEPARATE);
	}
	RETURN_CCTOR(reversed);

}
开发者ID:kissthink,项目名称:zephir,代码行数:29,代码来源:route.c

示例8: PHP_METHOD

/**
 * Starts every backend
 *
 * @param int|string $keyName
 * @param   long $lifetime
 * @return  mixed
 */
PHP_METHOD(Phalcon_Cache_Multiple, start){

	zval *key_name, *lifetime = NULL, *backends, *backend = NULL;
	HashTable *ah0;
	HashPosition hp0;
	zval **hd;

	PHALCON_MM_GROW();

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &key_name, &lifetime) == FAILURE) {
		RETURN_MM_NULL();
	}

	if (!lifetime) {
		PHALCON_INIT_VAR(lifetime);
	}
	
	PHALCON_OBS_VAR(backends);
	phalcon_read_property(&backends, this_ptr, SL("_backends"), PH_NOISY_CC);
	
	if (!phalcon_is_iterable(backends, &ah0, &hp0, 0, 0 TSRMLS_CC)) {
		return;
	}
	
	while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
	
		PHALCON_GET_FOREACH_VALUE(backend);
	
		PHALCON_CALL_METHOD_PARAMS_2_NORETURN(backend, "start", key_name, lifetime);
	
		zend_hash_move_forward_ex(ah0, &hp0);
	}
	
	
	PHALCON_MM_RESTORE();
}
开发者ID:BlueShark,项目名称:cphalcon,代码行数:43,代码来源:multiple.c

示例9: validate_thrift_object

//is used to validate objects before serialization and after deserialization. For now, only required fields are validated.
static
void validate_thrift_object(zval* object) {
    zend_class_entry* object_class_entry = Z_OBJCE_P(object);
    zval* is_validate = zend_read_static_property(object_class_entry, "isValidate", sizeof("isValidate")-1, false);
    zval* spec = zend_read_static_property(object_class_entry, "_TSPEC", sizeof("_TSPEC")-1, false);
    HashPosition key_ptr;
    zval* val_ptr;

    if (Z_TYPE_INFO_P(is_validate) == IS_TRUE) {
        for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(spec), &key_ptr);
           (val_ptr = zend_hash_get_current_data_ex(Z_ARRVAL_P(spec), &key_ptr)) != nullptr;
           zend_hash_move_forward_ex(Z_ARRVAL_P(spec), &key_ptr)) {

            zend_ulong fieldno;
            if (zend_hash_get_current_key_ex(Z_ARRVAL_P(spec), nullptr, &fieldno, &key_ptr) != HASH_KEY_IS_LONG) {
              throw_tprotocolexception("Bad keytype in TSPEC (expected 'long')", INVALID_DATA);
              return;
            }
            HashTable* fieldspec = Z_ARRVAL_P(val_ptr);

            // field name
            zval* zvarname = zend_hash_str_find(fieldspec, "var", sizeof("var")-1);
            char* varname = Z_STRVAL_P(zvarname);

            zval* is_required = zend_hash_str_find(fieldspec, "isRequired", sizeof("isRequired")-1);
            zval rv;
            zval* prop = zend_read_property(object_class_entry, object, varname, strlen(varname), false, &rv);

            if (Z_TYPE_INFO_P(is_required) == IS_TRUE && Z_TYPE_P(prop) == IS_NULL) {
                char errbuf[128];
                snprintf(errbuf, 128, "Required field %s.%s is unset!", ZSTR_VAL(object_class_entry->name), varname);
                throw_tprotocolexception(errbuf, INVALID_DATA);
            }
        }
    }
}
开发者ID:apupier,项目名称:fn,代码行数:37,代码来源:php_thrift_protocol7.cpp

示例10: PHP_METHOD

/**
 * Commmits active transactions within the manager
 *
 */
PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, commit){

	zval *transactions, *transaction = NULL, *connection = NULL;
	zval *is_under_transaction = NULL;
	HashTable *ah0;
	HashPosition hp0;
	zval **hd;

	PHALCON_MM_GROW();

	PHALCON_OBS_VAR(transactions);
	phalcon_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC);
	if (Z_TYPE_P(transactions) == IS_ARRAY) { 
	
		phalcon_is_iterable(transactions, &ah0, &hp0, 0, 0);
	
		while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
	
			PHALCON_GET_HVALUE(transaction);
	
			PHALCON_INIT_NVAR(connection);
			phalcon_call_method(connection, transaction, "getconnection");
	
			PHALCON_INIT_NVAR(is_under_transaction);
			phalcon_call_method(is_under_transaction, connection, "isundertransaction");
			if (zend_is_true(is_under_transaction)) {
				phalcon_call_method_noret(connection, "commit");
			}
	
			zend_hash_move_forward_ex(ah0, &hp0);
		}
	
	}
	
	PHALCON_MM_RESTORE();
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:40,代码来源:manager.c

示例11: PHP_METHOD

/**
 * Prints the messages in the session flasher
 *
 * @param string $type
 * @param boolean $remove
 */
PHP_METHOD(Phalcon_Flash_Session, output){

	zval *remove = NULL, *messages, *message = NULL, *type = NULL;
	HashTable *ah0;
	HashPosition hp0;
	zval **hd;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 0, 1, &remove);
	
	if (!remove) {
		PHALCON_INIT_VAR(remove);
		ZVAL_BOOL(remove, 1);
	}
	
	PHALCON_INIT_VAR(messages);
	phalcon_call_method_p1(messages, this_ptr, "_getsessionmessages", remove);
	if (Z_TYPE_P(messages) == IS_ARRAY) { 
	
		phalcon_is_iterable(messages, &ah0, &hp0, 0, 0);
	
		while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
	
			PHALCON_GET_HKEY(type, ah0, hp0);
			PHALCON_GET_HVALUE(message);
	
			phalcon_call_method_p2_noret(this_ptr, "outputmessage", type, message);
	
			zend_hash_move_forward_ex(ah0, &hp0);
		}
	
	}
	
	PHALCON_MM_RESTORE();
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:42,代码来源:session.c

示例12: PHP_METHOD

/**
 * Sets a global formatter
 *
 * @param Phalcon\Logger\FormatterInterface $formatter
 */
PHP_METHOD(Phalcon_Logger_Multiple, setFormatter){

	zval *formatter, *loggers, *logger = NULL;
	HashTable *ah0;
	HashPosition hp0;
	zval **hd;

	PHALCON_MM_GROW();

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &formatter) == FAILURE) {
		RETURN_MM_NULL();
	}

	PHALCON_OBS_VAR(loggers);
	phalcon_read_property_this(&loggers, this_ptr, SL("_loggers"), PH_NOISY_CC);
	if (Z_TYPE_P(loggers) == IS_ARRAY) { 
	
		if (!phalcon_is_iterable(loggers, &ah0, &hp0, 0, 0 TSRMLS_CC)) {
			return;
		}
	
		while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
	
			PHALCON_GET_FOREACH_VALUE(logger);
	
			PHALCON_CALL_METHOD_PARAMS_1_NORETURN(logger, "setformatter", formatter);
	
			zend_hash_move_forward_ex(ah0, &hp0);
		}
	
	}
	
	phalcon_update_property_this(this_ptr, SL("_formatter"), formatter TSRMLS_CC);
	
	PHALCON_MM_RESTORE();
}
开发者ID:101010111100,项目名称:cphalcon,代码行数:41,代码来源:multiple.c

示例13: PHP_METHOD

/**
 * Validate a set of data according to a set of rules
 *
 * @param array|object $data
 * @param object $entity
 * @return Phalcon\Validation\Message\Group
 */
PHP_METHOD(Phalcon_Validation, validate){

	zval *data = NULL, *entity = NULL, *validators, *messages = NULL, *status = NULL;
	zval *cancel_on_fail, *scope = NULL, *attribute = NULL, *validator = NULL;
	zval *must_cancel = NULL;
	HashTable *ah0;
	HashPosition hp0;
	zval **hd;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 0, 2, &data, &entity);
	
	if (!data) {
		PHALCON_INIT_VAR(data);
	}
	
	if (!entity) {
		PHALCON_INIT_VAR(entity);
	}
	
	PHALCON_OBS_VAR(validators);
	phalcon_read_property_this(&validators, this_ptr, SL("_validators"), PH_NOISY_CC);
	if (Z_TYPE_P(validators) != IS_ARRAY) { 
		PHALCON_THROW_EXCEPTION_STR(phalcon_validation_exception_ce, "There are no validators to validate");
		return;
	}
	
	/** 
	 * Clear pre-calculated values
	 */
	phalcon_update_property_null(this_ptr, SL("_values") TSRMLS_CC);
	
	/** 
	 * Implicitly creates a Phalcon\Validation\Message\Group object
	 */
	PHALCON_INIT_VAR(messages);
	object_init_ex(messages, phalcon_validation_message_group_ce);
	phalcon_call_method_noret(messages, "__construct");
	
	/** 
	 * Validation classes can implement the 'beforeValidation' callback
	 */
	if (phalcon_method_exists_ex(this_ptr, SS("beforevalidation") TSRMLS_CC) == SUCCESS) {
	
		PHALCON_INIT_VAR(status);
		phalcon_call_method_p3(status, this_ptr, "beforevalidation", data, entity, messages);
		if (PHALCON_IS_FALSE(status)) {
			RETURN_CCTOR(status);
		}
	}
	
	phalcon_update_property_this(this_ptr, SL("_messages"), messages TSRMLS_CC);
	if (Z_TYPE_P(data) == IS_ARRAY) { 
		phalcon_update_property_this(this_ptr, SL("_data"), data TSRMLS_CC);
	} else {
		if (Z_TYPE_P(data) == IS_OBJECT) {
			phalcon_update_property_this(this_ptr, SL("_data"), data TSRMLS_CC);
		}
	}
	
	PHALCON_INIT_VAR(cancel_on_fail);
	ZVAL_STRING(cancel_on_fail, "cancelOnFail", 1);
	
	phalcon_is_iterable(validators, &ah0, &hp0, 0, 0);
	
	while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
	
		PHALCON_GET_HVALUE(scope);
	
		if (Z_TYPE_P(scope) != IS_ARRAY) { 
			PHALCON_THROW_EXCEPTION_STR(phalcon_validation_exception_ce, "The validator scope is not valid");
			return;
		}
	
		PHALCON_OBS_NVAR(attribute);
		phalcon_array_fetch_long(&attribute, scope, 0, PH_NOISY_CC);
	
		PHALCON_OBS_NVAR(validator);
		phalcon_array_fetch_long(&validator, scope, 1, PH_NOISY_CC);
		if (Z_TYPE_P(validator) != IS_OBJECT) {
			PHALCON_THROW_EXCEPTION_STR(phalcon_validation_exception_ce, "One of the validators is not valid");
			return;
		}
	
		PHALCON_INIT_NVAR(status);
		phalcon_call_method_p2(status, validator, "validate", this_ptr, attribute);
	
		/** 
		 * Check if the validation must be canceled if this validator fails
		 */
		if (PHALCON_IS_FALSE(status)) {
	
//.........这里部分代码省略.........
开发者ID:RSivakov,项目名称:cphalcon,代码行数:101,代码来源:validation.c

示例14: PHP_METHOD


//.........这里部分代码省略.........
			
			PHALCON_INIT_VAR(identity_field);
			ZVAL_BOOL(identity_field, 0);
			
			PHALCON_INIT_VAR(columns);
			PHALCON_CALL_METHOD_PARAMS_2(columns, connection, "describecolumns", table, schema, PH_NO_CHECK);
			if (!phalcon_fast_count_ev(columns TSRMLS_CC)) {
				if (zend_is_true(schema)) {
					PHALCON_INIT_NVAR(complete_table);
					PHALCON_CONCAT_VSV(complete_table, schema, "\".\"", table);
				} else {
					PHALCON_CPY_WRT(complete_table, table);
				}
				
				PHALCON_INIT_NVAR(class_name);
				phalcon_get_class(class_name, model TSRMLS_CC);
				
				PHALCON_INIT_NVAR(exception_message);
				PHALCON_CONCAT_SVSV(exception_message, "Cannot obtain table columns for the mapped source \"", complete_table, "\" used in model ", class_name);
				PHALCON_THROW_EXCEPTION_ZVAL(phalcon_mvc_model_exception_ce, exception_message);
				return;
			}
			
			
			if (!phalcon_valid_foreach(columns TSRMLS_CC)) {
				return;
			}
			
			ah0 = Z_ARRVAL_P(columns);
			zend_hash_internal_pointer_reset_ex(ah0, &hp0);
			
			ph_cycle_start_0:
			
				if (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS) {
					goto ph_cycle_end_0;
				}
				
				PHALCON_GET_FOREACH_VALUE(column);
				
				PHALCON_INIT_NVAR(field_name);
				PHALCON_CALL_METHOD(field_name, column, "getname", PH_NO_CHECK);
				phalcon_array_append(&attributes, field_name, PH_SEPARATE TSRMLS_CC);
				
				PHALCON_INIT_NVAR(feature);
				PHALCON_CALL_METHOD(feature, column, "isprimary", PH_NO_CHECK);
				if (PHALCON_IS_TRUE(feature)) {
					phalcon_array_append(&primary_keys, field_name, PH_SEPARATE TSRMLS_CC);
				} else {
					phalcon_array_append(&non_primary_keys, field_name, PH_SEPARATE TSRMLS_CC);
				}
				
				PHALCON_INIT_NVAR(feature);
				PHALCON_CALL_METHOD(feature, column, "isnumeric", PH_NO_CHECK);
				if (PHALCON_IS_TRUE(feature)) {
					phalcon_array_update_zval_bool(&numeric_typed, field_name, 1, PH_SEPARATE TSRMLS_CC);
				}
				
				PHALCON_INIT_NVAR(feature);
				PHALCON_CALL_METHOD(feature, column, "isnotnull", PH_NO_CHECK);
				if (PHALCON_IS_TRUE(feature)) {
					phalcon_array_append(&not_null, field_name, PH_SEPARATE TSRMLS_CC);
				}
				
				PHALCON_INIT_NVAR(feature);
				PHALCON_CALL_METHOD(feature, column, "isautoincrement", PH_NO_CHECK);
				if (PHALCON_IS_TRUE(feature)) {
开发者ID:alantonilopez,项目名称:cphalcon,代码行数:67,代码来源:metadata.c

示例15: php_runkit_import_functions

/* {{{ php_runkit_import_functions
 */
static int php_runkit_import_functions(HashTable *function_table, long flags TSRMLS_DC)
{
	HashPosition pos;
	int i, func_count = zend_hash_num_elements(function_table);

	zend_hash_internal_pointer_reset_ex(function_table, &pos);
	for(i = 0; i < func_count; i++) {
		zend_function *fe = NULL;
		char *key, *new_key;
		int key_len, new_key_len, type;
		long idx;
		zend_bool add_function = 1;
		zend_bool exists = 0;

		zend_hash_get_current_data_ex(function_table, (void**)&fe, &pos);

		new_key = fe->common.function_name;
		new_key_len = strlen(new_key) + 1;

		if (((type = zend_hash_get_current_key_ex(function_table, &key, &key_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) &&
			fe && fe->type == ZEND_USER_FUNCTION) {

			if (type == HASH_KEY_IS_STRING) {
				new_key = key;
				new_key_len = key_len;
				exists = zend_hash_exists(EG(function_table), new_key, new_key_len);
			} else {
				exists = zend_hash_index_exists(EG(function_table), idx);
			}

			if (exists) {
				if (flags & PHP_RUNKIT_IMPORT_OVERRIDE) {
					if (type == HASH_KEY_IS_STRING) {
						if (zend_hash_del(EG(function_table), new_key, new_key_len) == FAILURE) {
							php_error_docref(NULL TSRMLS_CC, E_WARNING, "Inconsistency cleaning up import environment");
							return FAILURE;
						}
					} else {
						if (zend_hash_index_del(EG(function_table), idx) == FAILURE) {
							php_error_docref(NULL TSRMLS_CC, E_WARNING, "Inconsistency cleaning up import environment");
							return FAILURE;
						}
					}
				} else {
					add_function = 0;
				}
			}
		}

		if (add_function) {
			if (zend_hash_add(EG(function_table), new_key, new_key_len, fe, sizeof(zend_function), NULL) == FAILURE) {
				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failure importing %s()", fe->common.function_name);
#ifdef ZEND_ENGINE_2
				destroy_zend_function(fe TSRMLS_CC);
#else
				destroy_end_function(fe);
#endif
				return FAILURE;
			} else {
				fe->op_array.static_variables = NULL;
				(*fe->op_array.refcount)++;
			}
		}
		zend_hash_move_forward_ex(function_table, &pos);
	}

	return SUCCESS;
}
开发者ID:lltwox,项目名称:runkit,代码行数:70,代码来源:runkit_import.c


注:本文中的zend_hash_get_current_data_ex函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。