• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PHALCON_CALL_METHODW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: PHP_METHOD

/**
 * Returns a cached content
 *
 * @param int|string $keyName
 * @param   long $lifetime
 * @return  mixed
 */
PHP_METHOD(Phalcon_Cache_Backend_Memcache, get){

	zval *key_name, *lifetime = NULL, memcache = {}, frontend = {}, prefix = {}, prefixed_key = {}, cached_content = {};

	phalcon_fetch_params(0, 1, 1, &key_name, &lifetime);

	phalcon_return_property(&memcache, getThis(), SL("_memcache"));
	if (Z_TYPE(memcache) != IS_OBJECT) {
		PHALCON_CALL_METHODW(&memcache, getThis(), "_connect");
	}

	phalcon_return_property(&frontend, getThis(), SL("_frontend"));
	phalcon_return_property(&prefix, getThis(), SL("_prefix"));

	PHALCON_CONCAT_VV(&prefixed_key, &prefix, key_name);
	phalcon_update_property_zval(getThis(), SL("_lastKey"), &prefixed_key);

	PHALCON_CALL_METHODW(&cached_content, &memcache, "get", &prefixed_key);
	if (PHALCON_IS_FALSE(&cached_content)) {
		RETURN_NULL();
	}

	if (phalcon_is_numeric(&cached_content)) {
		RETURN_CTORW(&cached_content);
	}

	PHALCON_RETURN_CALL_METHOD(&frontend, "afterretrieve", &cached_content);
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:35,代码来源:memcache.c


示例2: PHP_METHOD

/**
 * Gets the column name in MySQL
 *
 * @param Phalcon\Db\ColumnInterface $column
 * @return string
 */
PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition){

	zval *column, size = {}, column_type = {}, column_sql = {}, type_values = {}, slash = {}, *value, value_cslashes = {}, is_unsigned = {}, scale = {}, name = {};
	int c, i = 0;

	phalcon_fetch_params(0, 1, 0, &column);
	PHALCON_VERIFY_INTERFACE_EX(column, phalcon_db_columninterface_ce, phalcon_db_exception_ce, 0);

	PHALCON_CALL_METHODW(&size, column, "getsize");
	PHALCON_CALL_METHODW(&column_type, column, "gettype");

	if (Z_TYPE(column_type) == IS_STRING) {
		PHALCON_CPY_WRT(&column_sql, &column_type);
		PHALCON_CALL_METHODW(&type_values, column, "gettypevalues");
		if (PHALCON_IS_NOT_EMPTY(&type_values)) {
			ZVAL_STRING(&slash, "\"");
			if (Z_TYPE(type_values) == IS_ARRAY) {
				c = phalcon_fast_count_int(&type_values);
				phalcon_concat_self_str(&column_sql, SL("("));
				ZEND_HASH_FOREACH_VAL(Z_ARRVAL(type_values), value) {
					i++;
					PHALCON_CALL_FUNCTIONW(&value_cslashes, "addcslashes", value, &slash);
					if (i < c) {
						PHALCON_SCONCAT_SVS(&column_sql, "\"", &value_cslashes, "\", ");
					} else {
						PHALCON_SCONCAT_SVS(&column_sql, "\"", &value_cslashes, "\"");
					}
				} ZEND_HASH_FOREACH_END();
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:34,代码来源:mysql.c


示例3: PHP_METHOD

/**
 * Create a new Query Builder for Delete
 *
 *
 * @return Phalcon\Mvc\Model\Query\Builder\Delete
 */
PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, createDeleteBuilder){

	zval *params = NULL, *_di = NULL, di = {}, service_name = {};

	phalcon_fetch_params(0, 0, 2, &params, &_di);

	if (!params) {
		params = &PHALCON_GLOBAL(z_null);
	}

	if (!_di) {
		_di = &PHALCON_GLOBAL(z_null);
	}

	if (Z_TYPE_P(_di) == IS_OBJECT) {
		PHALCON_VERIFY_INTERFACEW(_di, phalcon_diinterface_ce);
		PHALCON_CPY_WRT(&di, _di);
	} else {
		PHALCON_CALL_CE_STATICW(&di, phalcon_di_ce, "getdefault", _di);
	}

	PHALCON_STR(&service_name, ISV(modelsQueryBuilderForDelete));
	PHALCON_CALL_METHODW(return_value, &di, "get", &service_name, &PHALCON_GLOBAL(z_null), &PHALCON_GLOBAL(z_true));
	if (Z_TYPE_P(return_value) != IS_OBJECT) {
		object_init_ex(return_value, phalcon_mvc_model_query_builder_delete_ce);
		PHALCON_CALL_METHODW(NULL, return_value, "__construct", params);
	}

	PHALCON_VERIFY_INTERFACEW(return_value, phalcon_mvc_model_query_builderinterface_ce);
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:36,代码来源:builder.c


示例4: PHP_METHOD

/**
 * Checks whether put has certain index
 *
 * @param string $name
 * @return boolean
 */
PHP_METHOD(Phalcon_Http_Request, hasPut)
{
	zval *name, is_put = {}, put = {}, raw = {}, new_put = {};
	char *tmp;

	phalcon_fetch_params(0, 1, 0, &name);

	PHALCON_CALL_METHODW(&is_put, getThis(), "isput");

	if (!zend_is_true(&is_put)) {
		phalcon_read_global_str(&new_put, SL("_PUT"));
	} else {
		phalcon_read_property(&put, getThis(), SL("_put"), PH_NOISY);
		if (Z_TYPE(put) != IS_ARRAY) {
			PHALCON_CALL_METHODW(&raw, getThis(), "getrawbody");

			array_init(&new_put);

			PHALCON_ENSURE_IS_STRING(&raw);
			tmp = estrndup(Z_STRVAL(raw), Z_STRLEN(raw));
			sapi_module.treat_data(PARSE_STRING, tmp, &new_put);

			phalcon_update_property_zval(getThis(), SL("_put"), &new_put);
		} else {
			PHALCON_CPY_WRT(&new_put, &put);
		}
	}

	RETVAL_BOOL(phalcon_array_isset(&new_put, name));
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:36,代码来源:request.c


示例5: PHP_METHOD

/**
 * Starts the profile of a SQL sentence
 *
 * @param string $sqlStatement
 * @param $sqlVariables
 * @param $sqlBindTypes
 * @return Phalcon\Db\Profiler
 */
PHP_METHOD(Phalcon_Db_Profiler, startProfile){

	zval *sql_statement, *sql_variables = NULL, *sql_bindtypes = NULL, active_profile = {}, time = {};

	phalcon_fetch_params(0, 1, 2, &sql_statement, &sql_variables, &sql_bindtypes);

	object_init_ex(&active_profile, phalcon_db_profiler_item_ce);
	PHALCON_CALL_METHODW(NULL, &active_profile, "setsqlstatement", sql_statement);

	if (sql_variables) {
	    PHALCON_CALL_METHODW(NULL, &active_profile, "setsqlvariables", sql_variables);
	}

	if (sql_bindtypes) {
	    PHALCON_CALL_METHODW(NULL, &active_profile, "setsqlbindtypes", sql_bindtypes);
	}

	PHALCON_CALL_FUNCTIONW(&time, "microtime", &PHALCON_GLOBAL(z_true));
	PHALCON_CALL_METHODW(NULL, &active_profile, "setinitialtime", &time);

	if (phalcon_method_exists_ex(getThis(), SL("beforestartprofile")) == SUCCESS) {
		PHALCON_CALL_METHODW(NULL, getThis(), "beforestartprofile", &active_profile);
	}

	phalcon_update_property_zval(getThis(), SL("_activeProfile"), &active_profile);

	RETURN_THISW();
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:36,代码来源:profiler.c


示例6: PHP_METHOD

/**
 * Phalcon\Mvc\Model\Transaction constructor
 *
 * @param Phalcon\DIInterface $dependencyInjector
 * @param boolean $autoBegin
 * @param string $service
 */
PHP_METHOD(Phalcon_Mvc_Model_Transaction, __construct){

	zval *dependency_injector, *auto_begin = NULL, *s = NULL, service = {}, connection = {};

	phalcon_fetch_params(0, 1, 2, &dependency_injector, &auto_begin, &service);

	if (!auto_begin) {
		auto_begin = &PHALCON_GLOBAL(z_false);
	}

	if (!s || Z_TYPE_P(s) != IS_STRING) {
		ZVAL_STRING(&service, "db");
	} else {
		PHALCON_CPY_WRT(&service, s);
	}

	if (Z_TYPE_P(dependency_injector) != IS_OBJECT) {
		PHALCON_THROW_EXCEPTION_STRW(phalcon_mvc_model_transaction_exception_ce, "A dependency injector container is required to obtain the services related to the ORM");
		return;
	}

	PHALCON_CALL_METHODW(&connection, dependency_injector, "get", &service);

	phalcon_update_property_zval(getThis(), SL("_connection"), &connection);
	if (zend_is_true(auto_begin)) {
		PHALCON_CALL_METHODW(NULL, &connection, "begin");
	}
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:35,代码来源:transaction.c


示例7: PHP_METHOD

/**
 * Executes the validation
 *
 * @param Phalcon\Validation $validator
 * @param string $attribute
 * @return boolean
 */
PHP_METHOD(Phalcon_Validation_Validator_Between, validate){

	zval *validator, *attribute, value = {}, allow_empty = {}, minimum = {}, maximum = {}, label = {}, pairs = {}, valid = {}, message_str = {}, code = {}, prepared = {}, message = {};
	zend_class_entry *ce = Z_OBJCE_P(getThis());

	phalcon_fetch_params(0, 2, 0, &validator, &attribute);

	PHALCON_VERIFY_CLASS_EX(validator, phalcon_validation_ce, phalcon_validation_exception_ce, 0);

	PHALCON_CALL_METHODW(&value, validator, "getvalue", attribute);

	RETURN_ON_FAILURE(phalcon_validation_validator_getoption_helper(&allow_empty, ce, getThis(), ISV(allowEmpty)));
	if (zend_is_true(&allow_empty) && phalcon_validation_validator_isempty_helper(&value)) {
		RETURN_TRUE;
	}

	RETURN_ON_FAILURE(phalcon_validation_validator_getoption_helper(&minimum, ce, getThis(), "minimum"));
	RETURN_ON_FAILURE(phalcon_validation_validator_getoption_helper(&maximum, ce, getThis(), "maximum"));

	PHALCON_CALL_SELFW(&valid, "valid", &value, &minimum, &maximum);

	if (PHALCON_IS_FALSE(&valid)) {
		RETURN_ON_FAILURE(phalcon_validation_validator_getoption_helper(&label, ce, getThis(), ISV(label)));
		if (!zend_is_true(&label)) {
			PHALCON_CALL_METHODW(&label, validator, "getlabel", attribute);
			if (!zend_is_true(&label)) {
				PHALCON_CPY_WRT_CTOR(&label, attribute);
			}
		}

		array_init_size(&pairs, 3);
		phalcon_array_update_str(&pairs, SL(":field"), &label, PH_COPY);
		phalcon_array_update_str(&pairs, SL(":min"), &minimum, PH_COPY);
		phalcon_array_update_str(&pairs, SL(":max"), &maximum, PH_COPY);

		RETURN_ON_FAILURE(phalcon_validation_validator_getoption_helper(&message_str, ce, getThis(), ISV(message)));
		if (!zend_is_true(&message_str)) {
			RETURN_ON_FAILURE(phalcon_validation_getdefaultmessage_helper(&message_str, Z_OBJCE_P(validator), validator, "Between"));
		}

		RETURN_ON_FAILURE(phalcon_validation_validator_getoption_helper(&code, ce, getThis(), ISV(code)));
		if (Z_TYPE_P(&code) == IS_NULL) {
			ZVAL_LONG(&code, 0);
		}

		PHALCON_CALL_FUNCTIONW(&prepared, "strtr", &message_str, &pairs);

		phalcon_validation_message_construct_helper(&message, &prepared, attribute, "Between", &code);

		PHALCON_CALL_METHODW(NULL, validator, "appendmessage", &message);
		RETURN_FALSE;
	}

	RETURN_TRUE;
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:62,代码来源:between.c


示例8: PHP_METHOD

PHP_METHOD(Phalcon_Http_Uri, resolve)
{
	zval *uri, self = {};

	phalcon_fetch_params(0, 1, 0, &uri);

	object_init_ex(&self, phalcon_http_uri_ce);
	PHALCON_CALL_METHODW(NULL, &self, "__construct", getThis());
	PHALCON_CALL_METHODW(NULL, &self, "extend", uri);

	RETURN_CTORW(&self);
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:12,代码来源:uri.c


示例9: PHP_METHOD

/**
 * Applies a format to a message before sent it to the internal log
 *
 * @param string $message
 * @param int $type
 * @param int $timestamp
 * @param array $context
 * @return string
 */
PHP_METHOD(Phalcon_Logger_Formatter_Line, format){

	zval *message, *type, *timestamp, *context, format = {}, date_format = {}, date = {}, date_wildcard = {}, new_format = {}, type_string = {}, type_wildcard = {}, message_wildcard = {};

	phalcon_fetch_params(0, 4, 0, &message, &type, &timestamp, &context);

	phalcon_return_property(&format, getThis(), SL("_format"));

	/** 
	 * Check if the format has the %date% placeholder
	 */
	if (phalcon_memnstr_str(&format, SL("%date%"))) {
		phalcon_return_property(&date_format, getThis(), SL("_dateFormat"));

		phalcon_date(&date, &date_format, timestamp);

		ZVAL_STRING(&date_wildcard, "%date%");

		PHALCON_STR_REPLACE(&new_format, &date_wildcard, &date, &format);
	} else {
		PHALCON_CPY_WRT(&new_format, &format);
	}

	/** 
	 * Check if the format has the %type% placeholder
	 */
	if (phalcon_memnstr_str(&format, SL("%type%"))) {
		PHALCON_CALL_METHODW(&type_string, getThis(), "gettypestring", type);

		ZVAL_STRING(&type_wildcard, "%type%");

		PHALCON_STR_REPLACE(&format, &type_wildcard, &type_string, &new_format);
	} else {
		PHALCON_CPY_WRT(&format, &new_format);
	}

	ZVAL_STRING(&message_wildcard, "%message%");

	PHALCON_STR_REPLACE(&new_format, &message_wildcard, message, &format);

	if (Z_TYPE_P(context) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(context)) > 0) {
		PHALCON_CALL_METHODW(&format, getThis(), "interpolate", &new_format, context);
	}
	else {
		PHALCON_CPY_WRT(&format, &new_format);
	}

	PHALCON_CONCAT_VS(return_value, &format, PHP_EOL);
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:58,代码来源:line.c


示例10: 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


示例11: PHP_METHOD

/**
 * Load config file
 *
 * @param string $filePath
 */
PHP_METHOD(Phalcon_Config_Adapter_Yaml, read){

	zval *file_path, *absolute_path = NULL, config_dir_path = {}, *base_path = NULL, config = {};

	phalcon_fetch_params(0, 1, 1, &file_path, &absolute_path);
	PHALCON_ENSURE_IS_STRING(file_path);

	if (absolute_path == NULL) {
		absolute_path = &PHALCON_GLOBAL(z_false);
	}

	if (zend_is_true(absolute_path)) {
		PHALCON_CPY_WRT_CTOR(&config_dir_path, file_path);
	} else {
		base_path = phalcon_read_static_property_ce(phalcon_config_adapter_ce, SL("_basePath"));

		PHALCON_CONCAT_VV(&config_dir_path, base_path, file_path);
	}

	PHALCON_CALL_FUNCTIONW(&config, "yaml_parse_file", &config_dir_path);

	if (Z_TYPE(config) == IS_ARRAY) {
		PHALCON_CALL_METHODW(NULL, getThis(), "val", &config);
	}

	RETURN_THISW();
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:32,代码来源:yaml.c


示例12: PHP_METHOD

/**
 * Initializes the internal handler, calling functions on it
 *
 * @param string $method
 * @param array $arguments
 * @return mixed
 */
PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __call){

	zval *method, *arguments, handler = {}, definition = {}, call_handler = {};
	zend_class_entry *ce0;

	phalcon_fetch_params(0, 2, 0, &method, &arguments);

	phalcon_return_property(&handler, getThis(), SL("_handler"));
	if (Z_TYPE(handler) != IS_OBJECT) {
		phalcon_read_property(&definition, getThis(), SL("_definition"), PH_NOISY);
		ce0 = phalcon_fetch_class(&definition, ZEND_FETCH_CLASS_DEFAULT);

		PHALCON_OBJECT_INIT(&handler, ce0);
		if (phalcon_has_constructor(&handler)) {
			PHALCON_CALL_METHODW(NULL, &handler, "__construct");
		}
		phalcon_update_property_zval(getThis(), SL("_handler"), &handler);
	}

	array_init_size(&call_handler, 2);
	phalcon_array_append(&call_handler, &handler, PH_COPY);
	phalcon_array_append(&call_handler, method, PH_COPY);

	/** 
	 * Call the handler
	 */
	PHALCON_CALL_USER_FUNC_ARRAYW(return_value, &call_handler, arguments);
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:35,代码来源:lazyloader.c


示例13: PHP_METHOD

/**
 * Creates a form registering it in the forms manager
 *
 * @param string $name
 * @param object $entity
 * @return Phalcon\Forms\Form
 */
PHP_METHOD(Phalcon_Forms_Manager, create){

	zval *name = NULL, *entity = NULL, form = {};

	phalcon_fetch_params(0, 0, 2, &name, &entity);

	if (!name) {
		name = &PHALCON_GLOBAL(z_null);
	}

	if (!entity) {
		entity = &PHALCON_GLOBAL(z_null);
	}

	if (Z_TYPE_P(name) != IS_STRING) {
		PHALCON_THROW_EXCEPTION_STRW(phalcon_forms_exception_ce, "The form name must be string");
		return;
	}

	object_init_ex(&form, phalcon_forms_form_ce);
	PHALCON_CALL_METHODW(NULL, &form, "__construct", entity);

	phalcon_update_property_array(getThis(), SL("_forms"), name, &form);

	RETURN_CTORW(&form);
}
开发者ID:googlle,项目名称:cphalcon7,代码行数:33,代码来源:manager.c


示例14: PHP_METHOD

/**
 * Decrement of a given key, by number $value
 * 
 * @param  string $keyName
 * @param  long $value
 * @return mixed
 */
PHP_METHOD(Phalcon_Cache_Backend_Apc, decrement){

	zval *key_name, *value = NULL, prefix = {}, prefixed_key = {}, cached_content = {};

	phalcon_fetch_params(0, 1, 1, &key_name, &value);

	if (!value || Z_TYPE_P(value) == IS_NULL) {
		value = &PHALCON_GLOBAL(z_one);
	} else {
		PHALCON_ENSURE_IS_LONG(value);
	}

	phalcon_read_property(&prefix, getThis(), SL("_prefix"), PH_NOISY);

	PHALCON_CONCAT_SVV(&prefixed_key, "_PHCA", &prefix, key_name);
	phalcon_update_property_zval(getThis(), SL("_lastKey"), &prefixed_key);

	if (SUCCESS == phalcon_function_exists_ex(SL("apc_dec"))) {
		PHALCON_RETURN_CALL_FUNCTIONW("apc_dec", &prefixed_key, value);
	} else {
		PHALCON_CALL_FUNCTIONW(&cached_content, "apc_fetch", &prefixed_key);

		if (Z_TYPE(cached_content) == IS_LONG) {
			phalcon_sub_function(return_value, &cached_content, value);
			PHALCON_CALL_METHODW(NULL, getThis(), "save", key_name, return_value);
		} else {
			RETURN_FALSE;
		}
	}
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:37,代码来源:apc.c


示例15: PHP_METHOD

/**
 * Writes the log to the stream itself
 *
 * @param string $message
 * @param int $type
 * @param int $time
 * @param array $context
 */
PHP_METHOD(Phalcon_Logger_Adapter_Stream, logInternal){

	zval *message, *type, *time, *context, *stream, formatter = {}, applied_format = {};

	phalcon_fetch_params(0, 4, 0, &message, &type, &time, &context);

	stream = phalcon_read_property(getThis(), SL("_stream"), PH_NOISY);
	if (Z_TYPE_P(stream) != IS_RESOURCE) {
		PHALCON_THROW_EXCEPTION_STRW(phalcon_logger_exception_ce, "Cannot send message to the log because it is invalid");
		return;
	}

	PHALCON_CALL_METHODW(&formatter, getThis(), "getformatter");
	PHALCON_CALL_METHODW(&applied_format, &formatter, "format", message, type, time, context);
	PHALCON_CALL_FUNCTIONW(NULL, "fwrite", stream, &applied_format);
}
开发者ID:googlle,项目名称:cphalcon7,代码行数:24,代码来源:stream.c


示例16: PHP_METHOD

/**
 * Load config file
 *
 * @param string $filePath
 */
PHP_METHOD(Phalcon_Config_Adapter_Php, read){

	zval *file_path, *absolute_path = NULL, config_dir_path = {}, *base_path, config = {};

	phalcon_fetch_params(0, 1, 1, &file_path, &absolute_path);
	PHALCON_ENSURE_IS_STRING(file_path);

	if (absolute_path == NULL) {
		absolute_path = &PHALCON_GLOBAL(z_false);
	}

	if (zend_is_true(absolute_path)) {
		PHALCON_CPY_WRT(&config_dir_path, file_path);
	} else {
		base_path = phalcon_read_static_property_ce(phalcon_config_adapter_ce, SL("_basePath"));

		PHALCON_CONCAT_VV(&config_dir_path, base_path, file_path);
	}

	if (phalcon_require_ret(&config, Z_STRVAL(config_dir_path)) == FAILURE) {
		zend_throw_exception_ex(phalcon_config_exception_ce, 0, "Configuration file '%s' cannot be read", Z_STRVAL(config_dir_path));
		PHALCON_PTR_DTOR(&config_dir_path);
		return;
	}
	PHALCON_PTR_DTOR(&config_dir_path);

	if (Z_TYPE(config) == IS_ARRAY) {
		PHALCON_CALL_METHODW(NULL, getThis(), "val", &config);
	}
	PHALCON_PTR_DTOR(&config);
	RETURN_THISW();
}
开发者ID:googlle,项目名称:cphalcon7,代码行数:37,代码来源:php.c


示例17: PHP_METHOD

/**
 * Composite one image onto another
 *
 * @param Phalcon\Image\Adapter $mask  mask Image instance
 * @return Phalcon\Image\Adapter
 */
PHP_METHOD(Phalcon_Image_Adapter, mask) {

    zval *mask;

    phalcon_fetch_params(0, 1, 0, &mask);
    PHALCON_CALL_METHODW(NULL, this_ptr, "_mask", mask);
    RETURN_THISW();
}
开发者ID:9466,项目名称:cphalcon,代码行数:14,代码来源:adapter.c


示例18: PHP_METHOD

/**
 * Retrieve the URI path
 *
 * @return string
 */
PHP_METHOD(Phalcon_Http_Client_Adapter, getPath){

	zval base_uri = {};

	phalcon_read_property(&base_uri, getThis(), SL("_base_uri"), PH_NOISY);

	PHALCON_CALL_METHODW(return_value, &base_uri, "getpath");
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:13,代码来源:adapter.c


示例19: PHP_METHOD

/**
 * Merge modules with the existing ones
 *
 *<code>
 *	$application->addModules(array(
 *		'admin' => array(
 *			'className' => 'Multiple\Admin\Module',
 *			'path' => '../apps/admin/Module.php'
 *		)
 *	));
 *</code>
 *
 * @param array $modules
 */
PHP_METHOD(Phalcon_CLI_Console, addModules){

	zval *modules;

	phalcon_fetch_params(0, 1, 0, &modules);

	PHALCON_CALL_METHODW(return_value, getThis(), "registermodules", modules, &PHALCON_GLOBAL(z_true));
}
开发者ID:dreamsxin,项目名称:cphalcon7,代码行数:22,代码来源:console.c


示例20: PHP_METHOD

/**
 * Reads the cookie-related info from the SESSION to restore the cookie as it was set
 * This method is automatically called internally so normally you don't need to call it
 *
 * @return Phalcon\Http\Cookie
 */
PHP_METHOD(Phalcon_Http_Cookie, restore)
{
	zval *restored, *dependency_injector, service = {}, session = {}, name = {}, key = {}, definition = {}, expire = {}, domain = {}, path = {}, secure = {}, http_only = {};

	restored = phalcon_read_property(getThis(), SL("_restored"), PH_NOISY);
	if (!zend_is_true(restored)) {
		dependency_injector = phalcon_read_property(getThis(), SL("_dependencyInjector"), PH_NOISY);
		if (Z_TYPE_P(dependency_injector) == IS_OBJECT) {
			ZVAL_STRING(&service, ISV(session));

			PHALCON_CALL_METHODW(&session, dependency_injector, "getshared", &service);
			PHALCON_VERIFY_INTERFACEW(&session, phalcon_session_adapterinterface_ce);

			phalcon_return_property(&name, getThis(), SL("_name"));

			PHALCON_CONCAT_SV(&key, "_PHCOOKIE_", &name);

			PHALCON_CALL_METHODW(&definition, &session, "get", &key);
			if (Z_TYPE(definition) == IS_ARRAY) { 
				if (phalcon_array_isset_fetch_str(&expire, &definition, SL("expire"))) {
					phalcon_update_property_this(getThis(), SL("_expire"), &expire);
				}
				if (phalcon_array_isset_fetch_str(&domain, &definition, SL("domain"))) {
					phalcon_update_property_this(getThis(), SL("_domain"), &domain);
				}

				if (phalcon_array_isset_fetch_str(&path, &definition, SL("path"))) {
					phalcon_update_property_this(getThis(), SL("_path"), &path);
				}

				if (phalcon_array_isset_fetch_str(&secure, &definition, SL("secure"))) {
					phalcon_update_property_this(getThis(), SL("_secure"), &secure);
				}

				if (phalcon_array_isset_fetch_str(&http_only, &definition, SL("httpOnly"))) {
					phalcon_update_property_this(getThis(), SL("_httpOnly"), &http_only);
				}
			}
		}

		phalcon_update_property_bool(getThis(), SL("_restored"), 1);
	}

	RETURN_THISW();
}
开发者ID:googlle,项目名称:cphalcon7,代码行数:51,代码来源:cookie.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PHALCON_CALL_METHOD_NORETURN函数代码示例发布时间:2022-05-30
下一篇:
C++ PHALCON_CALL_FUNC_PARAMS_1函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap