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


C++ PHALCON_CONCAT_SV函数代码示例

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


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

示例1: PHP_METHOD

/**
 * Generates SQL to drop a view
 *
 * @param string $viewName
 * @param string $schemaName
 * @param boolean $ifExists
 * @return string
 */
PHP_METHOD(Phalcon_Db_Dialect_Oracle, dropView){

	zval *view_name, *schema_name, *if_exists = NULL, *view = NULL;
	zval *sql = NULL;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 2, 1, &view_name, &schema_name, &if_exists);
	
	if (!if_exists) {
		PHALCON_INIT_VAR(if_exists);
		ZVAL_BOOL(if_exists, 1);
	}
	
	if (zend_is_true(schema_name)) {
		PHALCON_INIT_VAR(view);
		PHALCON_CONCAT_SVSVS(view, "`", schema_name, "`.`", view_name, "`");
	} else {
		PHALCON_INIT_NVAR(view);
		PHALCON_CONCAT_SVS(view, "`", view_name, "`");
	}
	if (zend_is_true(if_exists)) {
		PHALCON_INIT_VAR(sql);
		PHALCON_CONCAT_SV(sql, "DROP VIEW IF EXISTS ", view);
	} else {
		PHALCON_INIT_NVAR(sql);
		PHALCON_CONCAT_SV(sql, "DROP VIEW ", view);
	}
	
	RETURN_CTOR(sql);
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:39,代码来源:oracle.c

示例2: PHP_METHOD

/**
 * Generates SQL to drop a view
 *
 * @param string $viewName
 * @param string $schemaName
 * @param boolean $ifExists
 * @return string
 */
PHP_METHOD(Phalcon_Db_Dialect_Oracle, dropView){

	zval *view_name, *schema_name, *if_exists = NULL, *view = NULL;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 2, 1, &view_name, &schema_name, &if_exists);
	
	if (!if_exists) {
		if_exists = PHALCON_GLOBAL(z_true);
	}
	
	if (zend_is_true(schema_name)) {
		PHALCON_INIT_VAR(view);
		PHALCON_CONCAT_SVSVS(view, "`", schema_name, "`.`", view_name, "`");
	} else {
		PHALCON_INIT_NVAR(view);
		PHALCON_CONCAT_SVS(view, "`", view_name, "`");
	}
	if (zend_is_true(if_exists)) {
		PHALCON_CONCAT_SV(return_value, "DROP VIEW IF EXISTS ", view);
	} else {
		PHALCON_CONCAT_SV(return_value, "DROP VIEW ", view);
	}
	
	PHALCON_MM_RESTORE();
}
开发者ID:100851766,项目名称:cphalcon,代码行数:35,代码来源:oracle.c

示例3: PHP_METHOD

/**
 * Write hex string to the current position in the file pointer
 * 
 * @return Phalcon\Binary\Writer
 */
PHP_METHOD(Phalcon_Binary_Writer, writeHexString){

	zval *str, *length = NULL, *low_nibble = NULL, len = {}, format = {}, result = {};

	phalcon_fetch_params(0, 1, 2, &str, &length, &low_nibble);

	if (length && Z_TYPE_P(length) != IS_NULL) {
		if (low_nibble && zend_is_true(low_nibble)) {
			PHALCON_CONCAT_SV(&format, "h", length);
		} else {
			PHALCON_CONCAT_SV(&format, "H", length);
		}
	} else {
		if (low_nibble && zend_is_true(low_nibble)) {
			ZVAL_STRING(&format, "h*");
		} else {
			ZVAL_STRING(&format, "H*");
		}
	}
	PHALCON_CALL_FUNCTIONW(&result, "pack", &format, str);

	ZVAL_LONG(&len, Z_STRLEN(result));

	PHALCON_CALL_METHODW(NULL, getThis(), "write", &result, &len);
	RETURN_THISW();
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:31,代码来源:writer.c

示例4: PHP_METHOD

/**
 * Generates SQL to drop a table
 *
 * @param  string $tableName
 * @param  string $schemaName
 * @param  boolean $ifExists
 * @return boolean
 */
PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropTable){

	zval *table_name = NULL, *schema_name = NULL, *if_exists = NULL, *table = NULL;
	zval *sql = NULL;

	PHALCON_MM_GROW();
	
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &table_name, &schema_name, &if_exists) == FAILURE) {
		PHALCON_MM_RESTORE();
		RETURN_NULL();
	}

	if (!if_exists) {
		PHALCON_ALLOC_ZVAL_MM(if_exists);
		ZVAL_BOOL(if_exists, 1);
	}
	
	if (zend_is_true(schema_name)) {
		PHALCON_INIT_VAR(table);
		PHALCON_CONCAT_SVSVS(table, "`", schema_name, "`.`", table_name, "`");
	} else {
		PHALCON_INIT_VAR(table);
		PHALCON_CONCAT_SVS(table, "`", table_name, "`");
	}
	if (zend_is_true(if_exists)) {
		PHALCON_INIT_VAR(sql);
		PHALCON_CONCAT_SV(sql, "DROP TABLE IF EXISTS ", table);
	} else {
		PHALCON_INIT_VAR(sql);
		PHALCON_CONCAT_SV(sql, "DROP TABLE ", table);
	}
	
	
	RETURN_CTOR(sql);
}
开发者ID:meibk,项目名称:cphalcon,代码行数:43,代码来源:mysql.c

示例5: PHP_METHOD

/**
 * Returns the active version (string)
 *
 * @return string
 */
PHP_METHOD(Phalcon_Version, get){

	zval *version, *major, *medium, *minor, *special, *special_number;
	zval *result, *suffix = NULL, *final_version;

	PHALCON_MM_GROW();

	PHALCON_INIT_VAR(version);
	PHALCON_CALL_SELF(version, this_ptr, "_getversion");
	
	PHALCON_INIT_VAR(major);
	phalcon_array_fetch_long(&major, version, 0, PH_NOISY_CC);
	
	PHALCON_INIT_VAR(medium);
	phalcon_array_fetch_long(&medium, version, 1, PH_NOISY_CC);
	
	PHALCON_INIT_VAR(minor);
	phalcon_array_fetch_long(&minor, version, 2, PH_NOISY_CC);
	
	PHALCON_INIT_VAR(special);
	phalcon_array_fetch_long(&special, version, 3, PH_NOISY_CC);
	
	PHALCON_INIT_VAR(special_number);
	phalcon_array_fetch_long(&special_number, version, 4, PH_NOISY_CC);
	
	PHALCON_INIT_VAR(result);
	PHALCON_CONCAT_VSVSVS(result, major, ".", medium, ".", minor, " ");
	
	if (phalcon_compare_strict_long(special, 1 TSRMLS_CC)) {
		PHALCON_INIT_VAR(suffix);
		PHALCON_CONCAT_SV(suffix, "ALPHA ", special_number);
		goto ph_end_0;
	}
	
	if (phalcon_compare_strict_long(special, 2 TSRMLS_CC)) {
		PHALCON_INIT_NVAR(suffix);
		PHALCON_CONCAT_SV(suffix, "BETA ", special_number);
		goto ph_end_0;
	}
	
	if (phalcon_compare_strict_long(special, 1 TSRMLS_CC)) {
		PHALCON_INIT_NVAR(suffix);
		PHALCON_CONCAT_SV(suffix, "RC ", special_number);
		goto ph_end_0;
	}
	
	PHALCON_INIT_NVAR(suffix);
	ZVAL_STRING(suffix, "", 1);
	goto ph_end_0;
	
	ph_end_0:
	phalcon_concat_self(result, suffix TSRMLS_CC);
	
	PHALCON_INIT_VAR(final_version);
	PHALCON_CALL_FUNC_PARAMS_1(final_version, "trim", result);
	
	RETURN_CCTOR(final_version);
}
开发者ID:alantonilopez,项目名称:cphalcon,代码行数:63,代码来源:version.c

示例6: PHP_METHOD

/**
 * Returns the active version (string)
 *
 * <code>
 * echo Phalcon\Version::get();
 * </code>
 *
 * @return string
 */
PHP_METHOD(Phalcon_Version, get){

	zval *version, *major, *medium, *minor, *special, *special_number;
	zval *result, *suffix = NULL, *final_version;

	PHALCON_MM_GROW();

	PHALCON_INIT_VAR(version);
	PHALCON_CALL_SELF(version, this_ptr, "_getversion");
	
	PHALCON_OBS_VAR(major);
	phalcon_array_fetch_long(&major, version, 0, PH_NOISY_CC);
	
	PHALCON_OBS_VAR(medium);
	phalcon_array_fetch_long(&medium, version, 1, PH_NOISY_CC);
	
	PHALCON_OBS_VAR(minor);
	phalcon_array_fetch_long(&minor, version, 2, PH_NOISY_CC);
	
	PHALCON_OBS_VAR(special);
	phalcon_array_fetch_long(&special, version, 3, PH_NOISY_CC);
	
	PHALCON_OBS_VAR(special_number);
	phalcon_array_fetch_long(&special_number, version, 4, PH_NOISY_CC);
	
	PHALCON_INIT_VAR(result);
	PHALCON_CONCAT_VSVSVS(result, major, ".", medium, ".", minor, " ");
	
	switch (phalcon_get_intval(special)) {
	
		case 1:
			PHALCON_INIT_VAR(suffix);
			PHALCON_CONCAT_SV(suffix, "ALPHA ", special_number);
			break;
	
		case 2:
			PHALCON_INIT_NVAR(suffix);
			PHALCON_CONCAT_SV(suffix, "BETA ", special_number);
			break;
	
		case 3:
			PHALCON_INIT_NVAR(suffix);
			PHALCON_CONCAT_SV(suffix, "RC ", special_number);
			break;
	
		default:
			PHALCON_INIT_NVAR(suffix);
			ZVAL_STRING(suffix, "", 1);
			break;
	
	}
	phalcon_concat_self(&result, suffix TSRMLS_CC);
	
	PHALCON_INIT_VAR(final_version);
	PHALCON_CALL_FUNC_PARAMS_1(final_version, "trim", result);
	RETURN_CCTOR(final_version);
}
开发者ID:bicouy0,项目名称:cphalcon,代码行数:66,代码来源:version.c

示例7: PHP_METHOD

/**
 * Receives events generated in the models and dispatches them to a events-manager if available
 * Notify the behaviors that are listening in the model
 *
 * @param string $eventName
 * @param Phalcon\Mvc\CollectionInterface $model
 */
PHP_METHOD(Phalcon_Mvc_Collection_Manager, notifyEvent){

	zval *event_name, *model, *status = NULL, *events_manager;
	zval *fire_event_name = NULL, *custom_events_manager;
	zval *entity_name;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 2, 0, &event_name, &model);
	
	PHALCON_INIT_VAR(status);
	
	/** 
	 * Dispatch events to the global events manager
	 */
	PHALCON_OBS_VAR(events_manager);
	phalcon_read_property_this(&events_manager, this_ptr, SL("_eventsManager"), PH_NOISY_CC);
	if (Z_TYPE_P(events_manager) == IS_OBJECT) {
	
		PHALCON_INIT_VAR(fire_event_name);
		PHALCON_CONCAT_SV(fire_event_name, "collection:", event_name);
	
		PHALCON_CALL_METHOD_PARAMS_2(status, events_manager, "fire", fire_event_name, model);
		if (PHALCON_IS_FALSE(status)) {
			RETURN_CCTOR(status);
		}
	}
	
	/** 
	 * A model can has a specific events manager for it
	 */
	PHALCON_OBS_VAR(custom_events_manager);
	phalcon_read_property_this(&custom_events_manager, this_ptr, SL("_customEventsManager"), PH_NOISY_CC);
	if (Z_TYPE_P(custom_events_manager) == IS_ARRAY) { 
	
		PHALCON_INIT_VAR(entity_name);
		phalcon_get_class(entity_name, model, 1 TSRMLS_CC);
		if (phalcon_array_isset(custom_events_manager, entity_name)) {
	
			PHALCON_INIT_NVAR(fire_event_name);
			PHALCON_CONCAT_SV(fire_event_name, "collection:", event_name);
	
			PHALCON_INIT_NVAR(status);
			PHALCON_CALL_METHOD_PARAMS_2(status, custom_events_manager, "fire", fire_event_name, model);
			if (PHALCON_IS_FALSE(status)) {
				RETURN_CCTOR(status);
			}
		}
	}
	
	
	RETURN_CCTOR(status);
}
开发者ID:101010111100,项目名称:cphalcon,代码行数:60,代码来源:manager.c

示例8: PHP_METHOD

/**
 * Returns the active version (string)
 *
 * <code>
 * echo Phalcon\Version::get();
 * </code>
 *
 * @return string
 */
PHP_METHOD(Phalcon_Version, get){

	zval *version = NULL, *major, *medium, *minor, *special, *special_number;
	zval *result, *suffix;

	PHALCON_MM_GROW();

	PHALCON_CALL_SELF(&version, "_getversion");

	PHALCON_OBS_VAR(major);
	phalcon_array_fetch_long(&major, version, 0, PH_NOISY);

	PHALCON_OBS_VAR(medium);
	phalcon_array_fetch_long(&medium, version, 1, PH_NOISY);

	PHALCON_OBS_VAR(minor);
	phalcon_array_fetch_long(&minor, version, 2, PH_NOISY);

	PHALCON_OBS_VAR(special);
	phalcon_array_fetch_long(&special, version, 3, PH_NOISY);

	PHALCON_OBS_VAR(special_number);
	phalcon_array_fetch_long(&special_number, version, 4, PH_NOISY);

	PHALCON_INIT_VAR(result);
	PHALCON_CONCAT_VSVSVS(result, major, ".", medium, ".", minor, " ");

	PHALCON_INIT_VAR(suffix);
	switch (phalcon_get_intval(special)) {

		case PHALCON_VERSION_ALPHA:
			PHALCON_CONCAT_SV(suffix, "ALPHA ", special_number);
			break;

		case PHALCON_VERSION_BETA:
			PHALCON_CONCAT_SV(suffix, "BETA ", special_number);
			break;

		case PHALCON_VERSION_RC:
			PHALCON_CONCAT_SV(suffix, "RC ", special_number);
			break;

		default:
			ZVAL_STRING(suffix, "", 1);
			break;

	}
	phalcon_concat_self(&result, suffix TSRMLS_CC);
	phalcon_fast_trim(return_value, result, PHALCON_TRIM_BOTH TSRMLS_CC);
	RETURN_MM();
}
开发者ID:CoolCloud,项目名称:cphalcon,代码行数:60,代码来源:version.c

示例9: PHP_METHOD

/**
 * Appends a NOT BETWEEN condition to the current conditions
 *
 *<code>
 *	$criteria->notBetweenWhere('price', 100.25, 200.50);
 *</code>
 *
 * @param string $expr
 * @param mixed $minimum
 * @param mixed $maximum
 * @return Phalcon\Mvc\Model\Query\Builder
 */
PHP_METHOD(Phalcon_Mvc_Model_Criteria, notBetweenWhere){

	zval *expr, *minimum, *maximum, *hidden_param, *one;
	zval *next_hidden_param, *minimum_key, *maximum_key;
	zval *conditions, *bind_params;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 3, 0, &expr, &minimum, &maximum);
	
	PHALCON_OBS_VAR(hidden_param);
	phalcon_read_property_this(&hidden_param, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(one);
	ZVAL_LONG(one, 1);
	
	PHALCON_INIT_VAR(next_hidden_param);
	phalcon_add_function(next_hidden_param, hidden_param, one TSRMLS_CC);
	
	/** 
	 * Minimum key with auto bind-params
	 */
	PHALCON_INIT_VAR(minimum_key);
	PHALCON_CONCAT_SV(minimum_key, "phb", hidden_param);
	
	/** 
	 * Maximum key with auto bind-params
	 */
	PHALCON_INIT_VAR(maximum_key);
	PHALCON_CONCAT_SV(maximum_key, "phb", next_hidden_param);
	
	/** 
	 * Create a standard BETWEEN condition with bind params
	 */
	PHALCON_INIT_VAR(conditions);
	PHALCON_CONCAT_VSVSVS(conditions, expr, " NOT BETWEEN :", minimum_key, ": AND :", maximum_key, ":");
	
	PHALCON_INIT_VAR(bind_params);
	array_init_size(bind_params, 2);
	phalcon_array_update_zval(&bind_params, minimum_key, &minimum, PH_COPY | PH_SEPARATE TSRMLS_CC);
	phalcon_array_update_zval(&bind_params, maximum_key, &maximum, PH_COPY | PH_SEPARATE TSRMLS_CC);
	
	/** 
	 * Append the BETWEEN to the current conditions using and 'and'
	 */
	phalcon_call_method_p2_noret(this_ptr, "andwhere", conditions, bind_params);
	PHALCON_SEPARATE(next_hidden_param);
	phalcon_increment(next_hidden_param);
	phalcon_update_property_this(this_ptr, SL("_hiddenParamNumber"), next_hidden_param TSRMLS_CC);
	RETURN_THIS();
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:63,代码来源:criteria.c

示例10: PHP_METHOD

/**
 * Gets HTTP header from request data
 *
 * @param string $header
 * @return string
 */
PHP_METHOD(Phalcon_Http_Request, getHeader){

	zval *header, *_SERVER, *server_value = NULL, *key;

	PHALCON_MM_GROW();

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

	phalcon_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC);
	if (phalcon_array_isset(_SERVER, header)) {
		PHALCON_OBS_VAR(server_value);
		phalcon_array_fetch(&server_value, _SERVER, header, PH_NOISY_CC);
		RETURN_CCTOR(server_value);
	} else {
		PHALCON_INIT_VAR(key);
		PHALCON_CONCAT_SV(key, "HTTP_", header);
		if (phalcon_array_isset(_SERVER, key)) {
			PHALCON_OBS_NVAR(server_value);
			phalcon_array_fetch(&server_value, _SERVER, key, PH_NOISY_CC);
			RETURN_CCTOR(server_value);
		}
	}
	PHALCON_MM_RESTORE();
	RETURN_EMPTY_STRING();
}
开发者ID:BlueShark,项目名称:cphalcon,代码行数:33,代码来源:request.c

示例11: PHP_METHOD

/**
 * Reads meta-data from $_SESSION
 *
 * @param string $key
 * @return array
 */
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, read){

	zval *key, *session, *prefix, *prefix_key;
	zval *meta_data;
	zval *r0, *r1 = NULL;

	PHALCON_MM_GROW();

	phalcon_fetch_params(0, 1, 0, &key);
	
	session = phalcon_get_global(SL("_SESSION"));
	
	prefix = phalcon_read_property(getThis(), SL("_prefix"), PH_NOISY);
	
	PHALCON_INIT_VAR(prefix_key);
	PHALCON_CONCAT_SV(prefix_key, "$PMM$", prefix);
	if (phalcon_array_isset_fetch(&r0, session, prefix_key)) {

		if (phalcon_array_isset(r0, key)) {
			PHALCON_OBS_VAR(r1);
			phalcon_array_fetch(&r1, session, prefix_key, PH_NOISY);
			PHALCON_OBS_VAR(meta_data);
			phalcon_array_fetch(&meta_data, r1, key, PH_NOISY);
			RETURN_CCTOR(meta_data);
		}
	}
	
	RETURN_MM_NULL();
}
开发者ID:Myleft,项目名称:cphalcon7,代码行数:35,代码来源:session.c

示例12: PHP_METHOD

/**
 * Gets the active connection unique identifier. A mysqli object
 *
 * @param boolean $asString
 * @return string
 */
PHP_METHOD(Phalcon_Db_Adapter_Mysql, getConnectionId){

	zval *as_string = NULL, *id_connection = NULL;
	zval *t0 = NULL;
	zval *r0 = NULL, *r1 = NULL;

	PHALCON_MM_GROW();
	
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &as_string) == FAILURE) {
		PHALCON_MM_RESTORE();
		RETURN_NULL();
	}

	if (!as_string) {
		PHALCON_INIT_VAR(as_string);
		ZVAL_BOOL(as_string, 0);
	}
	
	PHALCON_ALLOC_ZVAL_MM(t0);
	phalcon_read_property(&t0, this_ptr, SL("_idConnection"), PHALCON_NOISY TSRMLS_CC);
	PHALCON_CPY_WRT(id_connection, t0);
	if (zend_is_true(as_string)) {
		PHALCON_ALLOC_ZVAL_MM(r0);
		PHALCON_ALLOC_ZVAL_MM(r1);
		PHALCON_CALL_FUNC_PARAMS_1(r1, "mysqli_thread_id", id_connection);
		PHALCON_CONCAT_SV(r0, "Connection", r1);
		
		RETURN_CTOR(r0);
	} else {
		
		RETURN_CHECK_CTOR(id_connection);
	}
	
	PHALCON_MM_RESTORE();
}
开发者ID:rcpsec,项目名称:cphalcon,代码行数:41,代码来源:mysql.c

示例13: PHP_METHOD

/**
 * Phalcon\Translate\Adapter\Gettext constructor
 *
 * @param array $options
 * @throws \Phalcon\Translate\Exception
 */
PHP_METHOD(Phalcon_Translate_Adapter_Gettext, __construct){

	zval *options, *locale, *default_domain, *directory, *setting, *key = NULL, *value = NULL;
	HashTable *ah0;
	HashPosition hp0;
	zval **hd;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &options);
	
	if (Z_TYPE_P(options) != IS_ARRAY) { 
		PHALCON_THROW_EXCEPTION_STRW(phalcon_translate_exception_ce, "Invalid options");
		return;
	}

	if (!phalcon_array_isset_string_fetch(&locale, options, SS("locale"))) {
		PHALCON_THROW_EXCEPTION_STRW(phalcon_translate_exception_ce, "Parameter \"locale\" is required");
		return;
	}

	if (!phalcon_array_isset_string_fetch(&default_domain, options, SS("defaultDomain"))) {
		PHALCON_THROW_EXCEPTION_STRW(phalcon_translate_exception_ce, "Parameter \"defaultDomain\" is required");
		return;
	}

	if (!phalcon_array_isset_string_fetch(&directory, options, SS("directory"))) {
		PHALCON_THROW_EXCEPTION_STRW(phalcon_translate_exception_ce, "Parameter \"directory\" is required");
		return;
	}

	phalcon_update_property_this(this_ptr, SL("_locale"), locale TSRMLS_CC);
	phalcon_update_property_this(this_ptr, SL("_defaultDomain"), default_domain TSRMLS_CC);
	phalcon_update_property_this(this_ptr, SL("_directory"), directory TSRMLS_CC);

	PHALCON_INIT_VAR(setting);
	PHALCON_CONCAT_SV(setting, "LC_ALL=", locale);

	PHALCON_CALL_FUNCTION(NULL, "putenv", setting);

	setlocale(LC_ALL, Z_STRVAL_P(locale));
	
	if (Z_TYPE_P(directory) == IS_ARRAY) {
		phalcon_is_iterable(directory, &ah0, &hp0, 0, 0);
		while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) {
			PHALCON_GET_HKEY(key, ah0, hp0);
			PHALCON_GET_HVALUE(value);

			bindtextdomain(Z_STRVAL_P(key), Z_STRVAL_P(value));

			zend_hash_move_forward_ex(ah0, &hp0);
		}
	} else {
		bindtextdomain(Z_STRVAL_P(default_domain), Z_STRVAL_P(directory));
	}

	textdomain(Z_STRVAL_P(default_domain));

	PHALCON_MM_RESTORE();
}
开发者ID:9466,项目名称:cphalcon,代码行数:66,代码来源:gettext.c

示例14: PHP_METHOD

/**
 * Reads meta-data from $_SESSION
 *
 * @param string $key
 * @return array
 */
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, read){

	zval *key, *session = NULL, *_SESSION, *prefix, *prefix_key;
	zval *meta_data;
	zval *r0 = NULL, *r1 = NULL;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &key);
	
	phalcon_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC);
	PHALCON_CPY_WRT(session, _SESSION);
	
	PHALCON_OBS_VAR(prefix);
	phalcon_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(prefix_key);
	PHALCON_CONCAT_SV(prefix_key, "$PMM$", prefix);
	if (phalcon_array_isset(session, prefix_key)) {
	
		PHALCON_OBS_VAR(r0);
		phalcon_array_fetch(&r0, session, prefix_key, PH_NOISY_CC);
		if (phalcon_array_isset(r0, key)) {
			PHALCON_OBS_VAR(r1);
			phalcon_array_fetch(&r1, session, prefix_key, PH_NOISY_CC);
			PHALCON_OBS_VAR(meta_data);
			phalcon_array_fetch(&meta_data, r1, key, PH_NOISY_CC);
			RETURN_CCTOR(meta_data);
		}
	}
	
	RETURN_MM_NULL();
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:39,代码来源:session.c

示例15: PHP_METHOD

/**
 * Reads meta-data from $_SESSION
 *
 * @return array
 */
PHP_METHOD(Phalcon_Model_MetaData_Session, read){

	zval *session = NULL, *key = NULL;
	zval *g0 = NULL;
	zval *r0 = NULL, *r1 = NULL;
	zval *t0 = NULL;
	zval *a0 = NULL;
	int eval_int;

	PHALCON_MM_GROW();
	phalcon_get_global(&g0, "_SESSION", sizeof("_SESSION") TSRMLS_CC);
	PHALCON_CPY_WRT(session, g0);
	
	PHALCON_ALLOC_ZVAL_MM(r0);
	
	PHALCON_ALLOC_ZVAL_MM(t0);
	phalcon_read_property(&t0, this_ptr, "_suffix", sizeof("_suffix")-1, PHALCON_NOISY TSRMLS_CC);
	PHALCON_CONCAT_SV(r0, "$PMM$", t0);
	PHALCON_CPY_WRT(key, r0);
	eval_int = phalcon_array_isset(session, key);
	if (eval_int) {
		PHALCON_ALLOC_ZVAL_MM(r1);
		phalcon_array_fetch(&r1, session, key, PHALCON_NOISY TSRMLS_CC);
		
		PHALCON_RETURN_CHECK_CTOR(r1);
	}
	
	PHALCON_INIT_VAR(a0);
	array_init(a0);
	
	PHALCON_RETURN_CTOR(a0);
}
开发者ID:andresgutierrez,项目名称:cphalcon,代码行数:37,代码来源:session.c


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