本文整理汇总了C++中zend_update_property函数的典型用法代码示例。如果您正苦于以下问题:C++ zend_update_property函数的具体用法?C++ zend_update_property怎么用?C++ zend_update_property使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zend_update_property函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Phalcon\Mvc\Model\Validator constructor
*
* @param array $options
*/
PHP_METHOD(Phalcon_Mvc_Model_Validator, __construct){
zval *options = NULL;
zval *a0 = NULL, *a1 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(a0);
array_init(a0);
zend_update_property(phalcon_mvc_model_validator_ce, this_ptr, SL("_options"), a0 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a1);
array_init(a1);
zend_update_property(phalcon_mvc_model_validator_ce, this_ptr, SL("_messages"), a1 TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (Z_TYPE_P(options) != IS_ARRAY) {
PHALCON_THROW_EXCEPTION_STR(phalcon_mvc_model_exception_ce, "$options argument must be an Array");
return;
}
phalcon_update_property_zval(this_ptr, SL("_options"), options TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例2: yaf_route_simple_route
/** {{{ int yaf_route_simple_route(yaf_route_t *route, yaf_request_t *request)
*/
int yaf_route_simple_route(yaf_route_t *route, yaf_request_t *request) {
zval *module, *controller, *action;
zval *nmodule, *ncontroller, *naction;
nmodule = zend_read_property(yaf_route_simple_ce,
route, ZEND_STRL(YAF_ROUTE_SIMPLE_VAR_NAME_MODULE), 1, NULL);
ncontroller = zend_read_property(yaf_route_simple_ce,
route, ZEND_STRL(YAF_ROUTE_SIMPLE_VAR_NAME_CONTROLLER), 1, NULL);
naction = zend_read_property(yaf_route_simple_ce,
route, ZEND_STRL(YAF_ROUTE_SIMPLE_VAR_NAME_ACTION), 1, NULL);
/* if there is no expect parameter in supervars, then null will be return */
module = yaf_request_query(YAF_GLOBAL_VARS_GET, Z_STR_P(nmodule));
controller = yaf_request_query(YAF_GLOBAL_VARS_GET, Z_STR_P(ncontroller));
action = yaf_request_query(YAF_GLOBAL_VARS_GET, Z_STR_P(naction));
if (!module && !controller && !action) {
return 0;
}
if (module && Z_TYPE_P(module) == IS_STRING && yaf_application_is_module_name(Z_STR_P(module))) {
zend_update_property(yaf_request_ce, request, ZEND_STRL(YAF_REQUEST_PROPERTY_NAME_MODULE), module);
}
if (controller) {
zend_update_property(yaf_request_ce, request, ZEND_STRL(YAF_REQUEST_PROPERTY_NAME_CONTROLLER), controller);
}
if (action) {
zend_update_property(yaf_request_ce, request, ZEND_STRL(YAF_REQUEST_PROPERTY_NAME_ACTION), action);
}
return 1;
}
示例3: PHP_METHOD
PHP_METHOD(Phalcon_View, __construct){
zval *a0 = NULL, *a1 = NULL, *a2 = NULL, *a3 = NULL, *a4 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(a0);
array_init(a0);
zend_update_property(phalcon_view_ce, this_ptr, "_viewParams", strlen("_viewParams"), a0 TSRMLS_CC);
PHALCON_INIT_VAR(a1);
array_init(a1);
zend_update_property(phalcon_view_ce, this_ptr, "_templatesBefore", strlen("_templatesBefore"), a1 TSRMLS_CC);
PHALCON_INIT_VAR(a2);
array_init(a2);
zend_update_property(phalcon_view_ce, this_ptr, "_templatesAfter", strlen("_templatesAfter"), a2 TSRMLS_CC);
PHALCON_INIT_VAR(a3);
array_init(a3);
zend_update_property(phalcon_view_ce, this_ptr, "_registeredEngines", strlen("_registeredEngines"), a3 TSRMLS_CC);
PHALCON_INIT_VAR(a4);
array_init(a4);
zend_update_property(phalcon_view_ce, this_ptr, "_params", strlen("_params"), a4 TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例4: PHP_METHOD
PHP_METHOD(Phalcon_Mvc_Model_Manager, __construct){
zval *a0 = NULL, *a1 = NULL, *a2 = NULL, *a3 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(a0);
array_init(a0);
zend_update_property(phalcon_mvc_model_manager_ce, this_ptr, SL("_hasMany"), a0 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a1);
array_init(a1);
zend_update_property(phalcon_mvc_model_manager_ce, this_ptr, SL("_hasOne"), a1 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a2);
array_init(a2);
zend_update_property(phalcon_mvc_model_manager_ce, this_ptr, SL("_belongsTo"), a2 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a3);
array_init(a3);
zend_update_property(phalcon_mvc_model_manager_ce, this_ptr, SL("_initialized"), a3 TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例5: PHP_METHOD
/** {{{ public ZeStatus::__construct()
*/
PHP_METHOD(ze_status, __construct) {
zval * self = NULL;
zval * label = NULL;
zval * name = NULL;
zval * brief = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zz"
, &label
, &name
, &brief
) == FAILURE) {
WRONG_PARAM_COUNT;
}
self = getThis();
zend_update_property(ze_status_ce, self, ZEND_STRL(ZE_LABEL), label TSRMLS_CC);
if (name) {
zend_update_property(ze_status_ce, self, ZEND_STRL(ZE_NAME), name TSRMLS_CC);
}
if (brief) {
zend_update_property(ze_status_ce, self, ZEND_STRL(ZE_BRIEF) , brief TSRMLS_CC);
}
}
示例6: PHP_METHOD
/**
* Phalcon\Acl\Adapter\Memory constructor
*/
PHP_METHOD(Phalcon_Acl_Adapter_Memory, __construct){
zval *a0 = NULL, *a1 = NULL, *a2 = NULL;
PHALCON_MM_GROW();
phalcon_update_property_empty_array(phalcon_acl_adapter_memory_ce, this_ptr, SL("_rolesNames") TSRMLS_CC);
phalcon_update_property_empty_array(phalcon_acl_adapter_memory_ce, this_ptr, SL("_roles") TSRMLS_CC);
phalcon_update_property_empty_array(phalcon_acl_adapter_memory_ce, this_ptr, SL("_resources") TSRMLS_CC);
phalcon_update_property_empty_array(phalcon_acl_adapter_memory_ce, this_ptr, SL("_access") TSRMLS_CC);
phalcon_update_property_empty_array(phalcon_acl_adapter_memory_ce, this_ptr, SL("_roleInherits") TSRMLS_CC);
PHALCON_INIT_VAR(a0);
array_init_size(a0, 1);
add_assoc_bool_ex(a0, SS("*"), 1);
zend_update_property(phalcon_acl_adapter_memory_ce, this_ptr, SL("_resourcesNames"), a0 TSRMLS_CC);
PHALCON_INIT_VAR(a1);
array_init_size(a1, 1);
PHALCON_INIT_VAR(a2);
array_init_size(a2, 1);
add_assoc_bool_ex(a2, SS("*"), 1);
phalcon_array_update_string(&a1, SL("*"), &a2, PH_COPY | PH_SEPARATE TSRMLS_CC);
zend_update_property(phalcon_acl_adapter_memory_ce, this_ptr, SL("_accessList"), a1 TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例7: PHP_METHOD
/**
* Phalcon\Mvc\Router constructor
*
* @param boolean $defaultRoutes
*/
PHP_METHOD(Phalcon_Mvc_Router, __construct) {
zval *default_routes = NULL, *routes = NULL, *paths = NULL, *route = NULL;
zval *a0 = NULL, *a1 = NULL;
zval *c0 = NULL, *c1 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(a0);
array_init(a0);
zend_update_property(phalcon_mvc_router_ce, this_ptr, SL("_params"), a0 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a1);
array_init(a1);
zend_update_property(phalcon_mvc_router_ce, this_ptr, SL("_defaultParams"), a1 TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &default_routes) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!default_routes) {
PHALCON_ALLOC_ZVAL_MM(default_routes);
ZVAL_BOOL(default_routes, 1);
}
PHALCON_INIT_VAR(routes);
array_init(routes);
if (PHALCON_IS_TRUE(default_routes)) {
PHALCON_INIT_VAR(paths);
array_init(paths);
add_assoc_long_ex(paths, SL("controller")+1, 1);
PHALCON_INIT_VAR(route);
object_init_ex(route, phalcon_mvc_router_route_ce);
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, "#^/([a-zA-Z0-9\\_]+)[/]{0,1}$#", 1);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(route, "__construct", c0, paths, PH_CHECK);
phalcon_array_append(&routes, route, PH_SEPARATE TSRMLS_CC);
PHALCON_INIT_VAR(paths);
array_init(paths);
add_assoc_long_ex(paths, SL("controller")+1, 1);
add_assoc_long_ex(paths, SL("action")+1, 2);
add_assoc_long_ex(paths, SL("params")+1, 3);
PHALCON_INIT_VAR(route);
object_init_ex(route, phalcon_mvc_router_route_ce);
PHALCON_INIT_VAR(c1);
ZVAL_STRING(c1, "#^/([a-zA-Z0-9\\_]+)/([a-zA-Z0-9\\_]+)(/.*)*$#", 1);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(route, "__construct", c1, paths, PH_CHECK);
phalcon_array_append(&routes, route, PH_SEPARATE TSRMLS_CC);
}
phalcon_update_property_zval(this_ptr, SL("_routes"), routes TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例8: PHP_METHOD
/**
* Phalcon_Model_Validator constructor
*
* @param Phalcon_Model_Base $record
* @param string $field
* @param string $value
* @param array $options
*/
PHP_METHOD(Phalcon_Model_Validator, __construct){
zval *a0 = NULL, *a1 = NULL, *a2 = NULL;
zval *v0 = NULL, *v1 = NULL, *v2 = NULL, *v3 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(a0);
array_init(a0);
zend_update_property(phalcon_model_validator_class_entry, this_ptr, "_options", strlen("_options"), a0 TSRMLS_CC);
PHALCON_INIT_VAR(a1);
array_init(a1);
zend_update_property(phalcon_model_validator_class_entry, this_ptr, "_messages", strlen("_messages"), a1 TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z", &v0, &v1, &v2, &v3) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!v3) {
PHALCON_INIT_VAR(a2);
array_init(a2);
PHALCON_CPY_WRT(v3, a2);
}
phalcon_update_property_zval(this_ptr, "_record", strlen("_record"), v0 TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_fieldName", strlen("_fieldName"), v1 TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_value", strlen("_value"), v2 TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_options", strlen("_options"), v3 TSRMLS_CC);
PHALCON_MM_RESTORE();
RETURN_NULL();
}
示例9: PHP_METHOD
PHP_METHOD(Phalcon_Loader, __construct){
zval *a0 = NULL, *a1 = NULL, *a2 = NULL, *a3 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(a0);
array_init(a0);
zend_update_property(phalcon_loader_ce, this_ptr, SL("_classes"), a0 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a1);
array_init(a1);
add_next_index_stringl(a1, SL("php"), 1);
zend_update_property(phalcon_loader_ce, this_ptr, SL("_extensions"), a1 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a2);
array_init(a2);
zend_update_property(phalcon_loader_ce, this_ptr, SL("_namespaces"), a2 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(a3);
array_init(a3);
zend_update_property(phalcon_loader_ce, this_ptr, SL("_directories"), a3 TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例10: PHP_METHOD
/**
* Phalcon\Mvc\View constructor
*
* @param array $options
*/
PHP_METHOD(Phalcon_Mvc_View, __construct){
zval *options = NULL;
zval *a0 = NULL, *a1 = NULL, *a2 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(a0);
array_init(a0);
zend_update_property(phalcon_mvc_view_ce, this_ptr, SL("_viewParams"), a0 TSRMLS_CC);
PHALCON_INIT_VAR(a1);
array_init(a1);
zend_update_property(phalcon_mvc_view_ce, this_ptr, SL("_registeredEngines"), a1 TSRMLS_CC);
PHALCON_INIT_VAR(a2);
array_init(a2);
zend_update_property(phalcon_mvc_view_ce, this_ptr, SL("_params"), a2 TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!options) {
PHALCON_INIT_NVAR(options);
}
phalcon_update_property_zval(this_ptr, SL("_options"), options TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例11: PHP_METHOD
PHP_METHOD(MongoGridFS, __construct) {
zval *zdb, *files = 0, *chunks = 0, *zchunks;
// chunks is deprecated
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|zz", &zdb, mongo_ce_DB, &files, &chunks) == FAILURE) {
return;
}
if (!files && !chunks) {
MAKE_STD_ZVAL(files);
ZVAL_STRING(files, "fs.files", 1);
MAKE_STD_ZVAL(chunks);
ZVAL_STRING(chunks, "fs.chunks", 1);
}
else {
zval *temp_file;
char *temp;
if (Z_TYPE_P(files) != IS_STRING || Z_STRLEN_P(files) == 0 ) {
#if ZEND_MODULE_API_NO >= 20060613
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0
TSRMLS_CC,
"MongoGridFS::__construct(): invalid prefix");
#else
zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC,
"MongoGridFS::__construct(): invalid prefix");
#endif /* ZEND_MODULE_API_NO >= 20060613 */
return;
}
MAKE_STD_ZVAL(chunks);
spprintf(&temp, 0, "%s.chunks", Z_STRVAL_P(files));
ZVAL_STRING(chunks, temp, 0);
MAKE_STD_ZVAL(temp_file);
spprintf(&temp, 0, "%s.files", Z_STRVAL_P(files));
ZVAL_STRING(temp_file, temp, 0);
files = temp_file;
}
// create files collection
MONGO_METHOD2(MongoCollection, __construct, return_value, getThis(), zdb, files);
// create chunks collection
MAKE_STD_ZVAL(zchunks);
object_init_ex(zchunks, mongo_ce_Collection);
MONGO_METHOD2(MongoCollection, __construct, return_value, zchunks, zdb, chunks);
// add chunks collection as a property
zend_update_property(mongo_ce_GridFS, getThis(), "chunks", strlen("chunks"), zchunks TSRMLS_CC);
zend_update_property(mongo_ce_GridFS, getThis(), "filesName", strlen("filesName"), files TSRMLS_CC);
zend_update_property(mongo_ce_GridFS, getThis(), "chunksName", strlen("chunksName"), chunks TSRMLS_CC);
// cleanup
zval_ptr_dtor(&zchunks);
zval_ptr_dtor(&files);
zval_ptr_dtor(&chunks);
}
示例12: PHP_METHOD
/** {{{ 从文件载入js代码 */
PHP_METHOD(HyperMobile, loadjsfromfile) {
char *filename;
int filename_len;
char *contents;//,*err;
php_stream *stream;
int len;
zval *self,*value;
/* Parse arguments */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
return;
}
self=getThis();
if (strlen(filename) != filename_len) {
RETURN_FALSE;
}
stream = php_stream_open_wrapper(filename, "rb",
ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
if (!stream) {
RETURN_FALSE;
}
if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) > 0) {
if (PG(magic_quotes_runtime)) {
contents = php_addslashes(contents, len, &len, 1 TSRMLS_CC); /* 1 = free source string */
}
php_stream_close(stream);
//
MAKE_STD_ZVAL(value);
ZVAL_STRING(value,contents,0);
zend_update_property(Z_OBJCE_P(self),self,ZEND_STRL("js_content"),value TSRMLS_CC);
RETURN_TRUE;
} else if (len == 0) {
php_stream_close(stream);
MAKE_STD_ZVAL(value);
// err = ;
ZVAL_STRING(value,"file content is empty",0);
zend_update_property(Z_OBJCE_P(self),self,ZEND_STRL("err_msg"),value TSRMLS_CC);
zend_update_property_bool(Z_OBJCE_P(self),self,ZEND_STRL("error"),1 TSRMLS_CC);
RETURN_FALSE;
} else {
php_stream_close(stream);
MAKE_STD_ZVAL(value);
ZVAL_STRING(value,"unknown error",0);
zend_update_property(Z_OBJCE_P(self),self,ZEND_STRL("err_msg"),value TSRMLS_CC);
zend_update_property_bool(Z_OBJCE_P(self),self,ZEND_STRL("error"),1 TSRMLS_CC);
RETURN_FALSE;
}
}
示例13: yaf_route_simple_instance
/** {{{ yaf_route_t * yaf_route_simple_instance(yaf_route_t *this_ptr, zval *module, zval *controller, zval *action)
*/
yaf_route_t * yaf_route_simple_instance(yaf_route_t *this_ptr, zval *module, zval *controller, zval *action) {
if (Z_ISUNDEF_P(this_ptr)) {
object_init_ex(this_ptr, yaf_route_simple_ce);
}
zend_update_property(yaf_route_simple_ce, this_ptr, ZEND_STRL(YAF_ROUTE_SIMPLE_VAR_NAME_MODULE), module);
zend_update_property(yaf_route_simple_ce, this_ptr, ZEND_STRL(YAF_ROUTE_SIMPLE_VAR_NAME_CONTROLLER), controller);
zend_update_property(yaf_route_simple_ce, this_ptr, ZEND_STRL(YAF_ROUTE_SIMPLE_VAR_NAME_ACTION), action);
return this_ptr;
}
示例14: PHP_METHOD
PHP_METHOD(dataserv, create) {
zval * self = getThis();
zval * z_start, * z_end, * retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &z_start, &z_end) == FAILURE) {
WRONG_PARAM_COUNT;
}
zend_update_property(Z_OBJCE_P(self), self, ZEND_STRL("start"), z_start TSRMLS_CC);
zend_update_property(Z_OBJCE_P(self), self, ZEND_STRL("end"), z_end TSRMLS_CC);
zend_call_method_with_0_params(&self, Z_OBJCE_P(self), NULL, "insdata", &retval);
}
示例15: PHP_METHOD
/* {{{ PHP METHODS */
PHP_METHOD(air_router, __construct) {
AIR_INIT_THIS;
zval *or_arr;
MAKE_STD_ZVAL(or_arr);
array_init(or_arr);
zval *cr_arr;
MAKE_STD_ZVAL(cr_arr);
array_init(cr_arr);
zend_update_property(air_router_ce, self, ZEND_STRL("_original_rules"), or_arr TSRMLS_CC);
zend_update_property(air_router_ce, self, ZEND_STRL("_compiled_rules"), cr_arr TSRMLS_CC);
zval_ptr_dtor(&or_arr);
zval_ptr_dtor(&cr_arr);
}