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

C++ phalcon_read_property_this函数代码示例

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

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



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

示例1: PHP_METHOD

/**
 * Check whether the DI contains a service by a name
 *
 * @param string $name
 * @return boolean
 */
PHP_METHOD(Phalcon_DI, has){

	zval *name, *services, *is_set_service = NULL;
	zval *r0 = NULL;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &name);
	
	PHALCON_OBS_VAR(services);
	phalcon_read_property_this(&services, this_ptr, SL("_services"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(r0);
	ZVAL_BOOL(r0, phalcon_array_isset(services, name));
	PHALCON_CPY_WRT(is_set_service, r0);
	RETURN_NCTOR(is_set_service);
}
开发者ID:101010111100,项目名称:cphalcon,代码行数:23,代码来源:di.c


示例2: PHP_METHOD

/**
 * Returns the cache instance used to cache
 *
 * @return Phalcon\Cache\BackendInterface
 */
PHP_METHOD(Phalcon_Mvc_View_Simple, getCache){

	zval *cache = NULL;

	PHALCON_MM_GROW();

	PHALCON_OBS_VAR(cache);
	phalcon_read_property_this(&cache, this_ptr, SL("_cache"), PH_NOISY TSRMLS_CC);
	if (zend_is_true(cache)) {
		if (Z_TYPE_P(cache) != IS_OBJECT) {
			PHALCON_CALL_METHOD(&cache, this_ptr, "_createcache");
			phalcon_update_property_this(this_ptr, SL("_cache"), cache TSRMLS_CC);
		}
	}
	
	RETURN_CCTOR(cache);
}
开发者ID:100851766,项目名称:cphalcon,代码行数:22,代码来源:simple.c


示例3: PHP_METHOD

/**
 * Check whether is defined a translation key in the internal array
 *
 * @param 	string $index
 * @return bool
 */
PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, exists){

	zval *index, *translate, *exists = NULL;
	zval *r0 = NULL;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &index);
	
	PHALCON_OBS_VAR(translate);
	phalcon_read_property_this(&translate, this_ptr, SL("_translate"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(r0);
	ZVAL_BOOL(r0, phalcon_array_isset(translate, index));
	PHALCON_CPY_WRT(exists, r0);
	RETURN_NCTOR(exists);
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:23,代码来源:nativearray.c


示例4: PHP_METHOD

/**
 * Returns the javascript sources
 *
 * @return string
 */
PHP_METHOD(Phalcon_Debug, getJsSources){

	zval *uri, *sources;

	PHALCON_MM_GROW();

	PHALCON_OBS_VAR(uri);
	phalcon_read_property_this(&uri, this_ptr, SL("_uri"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(sources);
	PHALCON_CONCAT_SVS(sources, "<script type=\"text/javascript\" src=\"", uri, "jquery/jquery.js\"></script>");
	PHALCON_SCONCAT_SVS(sources, "<script type=\"text/javascript\" src=\"", uri, "jquery/jquery-ui.js\"></script>");
	PHALCON_SCONCAT_SVS(sources, "<script type=\"text/javascript\" src=\"", uri, "jquery/jquery.scrollTo.js\"></script>");
	PHALCON_SCONCAT_SVS(sources, "<script type=\"text/javascript\" src=\"", uri, "prettify/prettify.js\"></script>");
	PHALCON_SCONCAT_SVS(sources, "<script type=\"text/javascript\" src=\"", uri, "pretty.js\"></script>");
	RETURN_CTOR(sources);
}
开发者ID:Diego-Brocanelli,项目名称:cphalcon,代码行数:22,代码来源:debug.c


示例5: PHP_METHOD

/**
 * Check whether a option has been defined in the validator options
 *
 * @param string $option
 * @return boolean
 */
PHP_METHOD(Phalcon_Mvc_Model_Validator, isSetOption){

	zval *option, *options, *is_set = NULL;
	zval *r0 = NULL;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &option);
	
	PHALCON_OBS_VAR(options);
	phalcon_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(r0);
	ZVAL_BOOL(r0, phalcon_array_isset(options, option));
	PHALCON_CPY_WRT(is_set, r0);
	RETURN_NCTOR(is_set);
}
开发者ID:11mariom,项目名称:cphalcon,代码行数:23,代码来源:validator.c


示例6: PHP_METHOD

/**
 * Generates a pseudo random token value to be used as input's value in a CSRF check
 *
 * @param int $numberBytes
 * @return string
 */
PHP_METHOD(Phalcon_Security, getToken){

	zval *number_bytes = NULL, *random_bytes, *token, *dependency_injector;
	zval *service, *session, *key;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 0, 1, &number_bytes);
	
	if (!number_bytes) {
		PHALCON_INIT_VAR(number_bytes);
		ZVAL_LONG(number_bytes, 12);
	}
	
	if (phalcon_function_exists_ex(SS("openssl_random_pseudo_bytes") TSRMLS_CC) == FAILURE) {
		PHALCON_THROW_EXCEPTION_STR(phalcon_security_exception_ce, "Openssl extension must be loaded");
		return;
	}
	
	PHALCON_INIT_VAR(random_bytes);
	phalcon_call_func_p1(random_bytes, "openssl_random_pseudo_bytes", number_bytes);
	
	PHALCON_INIT_VAR(token);
	phalcon_md5(token, random_bytes);
	
	PHALCON_OBS_VAR(dependency_injector);
	phalcon_read_property_this(&dependency_injector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);
	if (Z_TYPE_P(dependency_injector) != IS_OBJECT) {
		PHALCON_THROW_EXCEPTION_STR(phalcon_flash_exception_ce, "A dependency injection container is required to access the 'session' service");
		return;
	}
	
	PHALCON_INIT_VAR(service);
	ZVAL_STRING(service, "session", 1);
	
	PHALCON_INIT_VAR(session);
	phalcon_call_method_p1(session, dependency_injector, "getshared", service);
	PHALCON_VERIFY_INTERFACE(session, phalcon_session_adapterinterface_ce);
	
	PHALCON_INIT_VAR(key);
	ZVAL_STRING(key, "$PHALCON/CSRF$", 1);
	phalcon_call_method_p2_noret(session, "set", key, token);
	
	RETURN_CTOR(token);
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:51,代码来源:security.c


示例7: PHP_METHOD

/**
 * Checks whether the behavior must take action on certain event
 *
 * @param string $eventName
 */
PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction){

	zval *event_name, *options;

	PHALCON_MM_GROW();

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

	PHALCON_OBS_VAR(options);
	phalcon_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);
	if (phalcon_array_isset(options, event_name)) {
		RETURN_MM_TRUE;
	}
	
	RETURN_MM_FALSE;
}
开发者ID:101010111100,项目名称:cphalcon,代码行数:23,代码来源:behavior.c


示例8: PHP_METHOD

/**
 * Gets a header value from the internal bag
 *
 * @param string $name
 * @return string
 */
PHP_METHOD(Phalcon_Http_Response_Headers, get){

	zval *name, *headers, *header_value;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &name);
	
	PHALCON_OBS_VAR(headers);
	phalcon_read_property_this(&headers, this_ptr, SL("_headers"), PH_NOISY_CC);
	if (phalcon_array_isset(headers, name)) {
		PHALCON_OBS_VAR(header_value);
		phalcon_array_fetch(&header_value, headers, name, PH_NOISY);
		RETURN_CCTOR(header_value);
	}
	
	RETURN_MM_FALSE;
}
开发者ID:11mariom,项目名称:cphalcon,代码行数:24,代码来源:headers.c


示例9: PHP_METHOD

/**
 * Magic method to retrieve a variable passed to the view
 *
 *<code>
 *	echo $this->view->products;
 *</code>
 *
 * @param string $key
 * @return mixed
 */
PHP_METHOD(Phalcon_Mvc_View_Simple, __get){

	zval *key, *params, *value;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &key);
	
	PHALCON_OBS_VAR(params);
	phalcon_read_property_this(&params, this_ptr, SL("_viewParams"), PH_NOISY_CC);
	if (phalcon_array_isset(params, key)) {
		PHALCON_OBS_VAR(value);
		phalcon_array_fetch(&value, params, key, PH_NOISY);
		RETURN_CCTOR(value);
	}
	
	RETURN_MM_NULL();
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:28,代码来源:simple.c


示例10: PHP_METHOD

/**
 * Check if records in belongs-to/has-many are implicitly cached during the current request
 *
 * @return boolean
 */
PHP_METHOD(Phalcon_Mvc_Model_Relation, isReusable){

	zval *options, *reusable;

	PHALCON_MM_GROW();

	PHALCON_OBS_VAR(options);
	phalcon_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);
	if (Z_TYPE_P(options) == IS_ARRAY) { 
		if (phalcon_array_isset_string(options, SS("reusable"))) {
			PHALCON_OBS_VAR(reusable);
			phalcon_array_fetch_string(&reusable, options, SL("reusable"), PH_NOISY_CC);
			RETURN_CCTOR(reusable);
		}
	}
	
	RETURN_MM_FALSE;
}
开发者ID:angkatan21,项目名称:cphalcon,代码行数:23,代码来源:relation.c


示例11: PHP_METHOD

/**
 * Sets a prefix for all the URIs to be generated
 *
 *<code>
 *	$url->setBaseUri('/invo/');
 *	$url->setBaseUri('/invo/index.php/');
 *</code>
 *
 * @param string $baseUri
 * @return Phalcon\Mvc\Url
 */
PHP_METHOD(Phalcon_Mvc_Url, setBaseUri){

	zval *base_uri, *static_base_uri;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &base_uri);
	
	phalcon_update_property_this(this_ptr, SL("_baseUri"), base_uri TSRMLS_CC);
	
	PHALCON_OBS_VAR(static_base_uri);
	phalcon_read_property_this(&static_base_uri, this_ptr, SL("_staticBaseUri"), PH_NOISY TSRMLS_CC);
	if (Z_TYPE_P(static_base_uri) == IS_NULL) {
		phalcon_update_property_this(this_ptr, SL("_staticBaseUri"), base_uri TSRMLS_CC);
	}
	
	RETURN_THIS();
}
开发者ID:9466,项目名称:cphalcon,代码行数:29,代码来源:url.c


示例12: PHP_METHOD

/**
 * Check whether certain type of event has listeners
 *
 * @param string $type
 * @return boolean
 */
PHP_METHOD(Phalcon_Events_Manager, hasListeners){

	zval *type, *events;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 1, 0, &type);
	
	PHALCON_OBS_VAR(events);
	phalcon_read_property_this(&events, this_ptr, SL("_events"), PH_NOISY_CC);
	if (Z_TYPE_P(events) == IS_ARRAY) { 
		if (phalcon_array_isset(events, type)) {
			RETURN_MM_TRUE;
		}
	}
	
	RETURN_MM_FALSE;
}
开发者ID:11mariom,项目名称:cphalcon,代码行数:24,代码来源:manager.c


示例13: PHP_METHOD

/**
 * Writes the meta-data to $_SESSION
 *
 * @param string $key
 * @param array $data
 */
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, write){

	zval *key, *data, *prefix, *prefix_key, *_SESSION;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 2, 0, &key, &data);
	
	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);
	phalcon_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC);
	phalcon_array_update_multi_2(&_SESSION, prefix_key, key, &data, 0 TSRMLS_CC);
	
	PHALCON_MM_RESTORE();
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:24,代码来源:session.c


示例14: PHP_METHOD

/**
 * Returns the internal formatter
 *
 * @return Phalcon\Logger\Formatter\Line
 */
PHP_METHOD(Phalcon_Logger_Adapter_File, getFormatter){

	zval *formatter = NULL;

	PHALCON_MM_GROW();

	PHALCON_OBS_VAR(formatter);
	phalcon_read_property_this(&formatter, this_ptr, SL("_formatter"), PH_NOISY_CC);
	if (Z_TYPE_P(formatter) != IS_OBJECT) {
		PHALCON_INIT_NVAR(formatter);
		object_init_ex(formatter, phalcon_logger_formatter_line_ce);
		phalcon_call_method_noret(formatter, "__construct");
	
		phalcon_update_property_this(this_ptr, SL("_formatter"), formatter TSRMLS_CC);
	}
	
	RETURN_CCTOR(formatter);
}
开发者ID:DonOzone,项目名称:cphalcon,代码行数:23,代码来源:file.c


示例15: PHP_METHOD

/**
 * Writes parsed annotations to files
 *
 * @param string $key
 * @param Phalcon\Annotations\Reflection $data
 */
PHP_METHOD(Phalcon_Annotations_Adapter_Files, write){

	zval *key, *data, *annotations_dir, *separator;
	zval *virtual_key, *path, *to_string, *export, *php_export;
	zval *status;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 2, 0, &key, &data);
	
	PHALCON_OBS_VAR(annotations_dir);
	phalcon_read_property_this(&annotations_dir, this_ptr, SL("_annotationsDir"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(separator);
	ZVAL_STRING(separator, "_", 1);
	
	/** 
	 * Paths must be normalized before be used as keys
	 */
	PHALCON_INIT_VAR(virtual_key);
	phalcon_prepare_virtual_path(virtual_key, key, separator TSRMLS_CC);
	
	PHALCON_INIT_VAR(path);
	PHALCON_CONCAT_VVS(path, annotations_dir, virtual_key, ".php");
	
	PHALCON_INIT_VAR(to_string);
	ZVAL_BOOL(to_string, 1);
	
	PHALCON_INIT_VAR(export);
	phalcon_call_func_p2(export, "var_export", data, to_string);
	
	PHALCON_INIT_VAR(php_export);
	PHALCON_CONCAT_SVS(php_export, "<?php return ", export, "; ");
	
	PHALCON_INIT_VAR(status);
	phalcon_file_put_contents(status, path, php_export TSRMLS_CC);
	if (PHALCON_IS_FALSE(status)) {
		PHALCON_THROW_EXCEPTION_STR(phalcon_annotations_exception_ce, "Annotations directory cannot be written");
		return;
	}
	
	PHALCON_MM_RESTORE();
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:49,代码来源:files.c


示例16: PHP_METHOD

/**
 * Generates a local path
 *
 * @param string $path
 * @return string
 */
PHP_METHOD(Phalcon_Mvc_Url, path){

	zval *path = NULL, *base_path, *final_path;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 0, 1, &path);
	
	if (!path) {
		PHALCON_INIT_VAR(path);
	}
	
	PHALCON_OBS_VAR(base_path);
	phalcon_read_property_this(&base_path, this_ptr, SL("_basePath"), PH_NOISY_CC);
	
	PHALCON_INIT_VAR(final_path);
	PHALCON_CONCAT_VV(final_path, base_path, path);
	RETURN_CTOR(final_path);
}
开发者ID:angkatan21,项目名称:cphalcon,代码行数:25,代码来源:url.c


示例17: PHP_METHOD

/**
 * Create internal connection to memcached
 */
PHP_METHOD(Phalcon_Cache_Backend_Memcache, _connect){

	zval *options, *memcache, *host, *port, *persistent;
	zval *success;
	zend_class_entry *ce0;

	PHALCON_MM_GROW();

	PHALCON_OBS_VAR(options);
	phalcon_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);
	ce0 = zend_fetch_class(SL("Memcache"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
	
	PHALCON_INIT_VAR(memcache);
	object_init_ex(memcache, ce0);
	if (phalcon_has_constructor(memcache TSRMLS_CC)) {
		phalcon_call_method_noret(memcache, "__construct");
	}
	
	PHALCON_OBS_VAR(host);
	phalcon_array_fetch_string(&host, options, SL("host"), PH_NOISY);
	
	PHALCON_OBS_VAR(port);
	phalcon_array_fetch_string(&port, options, SL("port"), PH_NOISY);
	
	PHALCON_OBS_VAR(persistent);
	phalcon_array_fetch_string(&persistent, options, SL("persistent"), PH_NOISY);

	PHALCON_INIT_VAR(success);
	if (zend_is_true(persistent)) {
		phalcon_call_method_p2(success, memcache, "pconnect", host, port);
	} else {
		phalcon_call_method_p2(success, memcache, "connect", host, port);
	}
	
	if (!zend_is_true(success)) {
		PHALCON_THROW_EXCEPTION_STR(phalcon_cache_exception_ce, "Cannot connect to Memcached server");
		return;
	}
	
	phalcon_update_property_this(this_ptr, SL("_memcache"), memcache TSRMLS_CC);
	
	PHALCON_MM_RESTORE();
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:46,代码来源:memcache.c


示例18: PHP_METHOD

/**
 * Checks whether there are messages attached to the element
 *
 * @return boolean
 */
PHP_METHOD(Phalcon_Forms_Element, hasMessages){

	zval *messages;

	PHALCON_MM_GROW();

	/** 
	 * Get the related form
	 */
	PHALCON_OBS_VAR(messages);
	phalcon_read_property_this(&messages, this_ptr, SL("_messages"), PH_NOISY_CC);
	if (Z_TYPE_P(messages) == IS_OBJECT) {
		if (phalcon_fast_count_ev(messages TSRMLS_CC)) {
			RETURN_MM_TRUE;
		}
	}
	
	RETURN_MM_FALSE;
}
开发者ID:RSivakov,项目名称:cphalcon,代码行数:24,代码来源:element.c


示例19: PHP_METHOD

/**
 * Returns the cache lifetime
 *
 * @return integer
 */
PHP_METHOD(Phalcon_Cache_Frontend_Base64, getLifetime){

	zval *options, *lifetime;

	PHALCON_MM_GROW();

	PHALCON_OBS_VAR(options);
	phalcon_read_property_this(&options, this_ptr, SL("_frontendOptions"), PH_NOISY_CC);
	if (Z_TYPE_P(options) == IS_ARRAY) { 
		if (phalcon_array_isset_string(options, SS("lifetime"))) {
			PHALCON_OBS_VAR(lifetime);
			phalcon_array_fetch_string(&lifetime, options, SL("lifetime"), PH_NOISY);
			RETURN_CCTOR(lifetime);
		}
	}
	
	PHALCON_MM_RESTORE();
	RETURN_LONG(1);
}
开发者ID:CreativeOutbreak,项目名称:cphalcon,代码行数:24,代码来源:base64.c


示例20: PHP_METHOD

/**
 *  Writes the metadata to XCache
 *
 * @param string $key
 * @param array $data
 */
PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, write){

	zval *key, *data, *prefix, *xc_key, *ttl;

	PHALCON_MM_GROW();

	phalcon_fetch_params(1, 2, 0, &key, &data);
	
	prefix = phalcon_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY TSRMLS_CC);
	
	PHALCON_INIT_VAR(xc_key);
	PHALCON_CONCAT_SVV(xc_key, "$PMM$", prefix, key);
	
	PHALCON_OBS_VAR(ttl);
	phalcon_read_property_this(&ttl, this_ptr, SL("_ttl"), PH_NOISY TSRMLS_CC);
	PHALCON_CALL_FUNCTION(NULL, "xcache_set", xc_key, data, ttl);
	
	PHALCON_MM_RESTORE();
}
开发者ID:100851766,项目名称:cphalcon,代码行数:25,代码来源:xcache.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ phalcon_update_property_array函数代码示例发布时间:2022-05-30
下一篇:
C++ phalcon_read_property函数代码示例发布时间: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