这篇教程C++ zend_exception_get_default函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zend_exception_get_default函数的典型用法代码示例。如果您正苦于以下问题:C++ zend_exception_get_default函数的具体用法?C++ zend_exception_get_default怎么用?C++ zend_exception_get_default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zend_exception_get_default函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PHP_METHODPHP_METHOD(Test_Exceptions, testExceptionLiteral) { zval *type_param = NULL; zval *type = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); zephir_get_strval(type, type_param); do { if (ZEPHIR_IS_STRING(type, "string")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "Test", "test/exceptions.zep", 53); return; } if (ZEPHIR_IS_STRING(type, "char")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "t", "test/exceptions.zep", 55); return; } if (ZEPHIR_IS_STRING(type, "int")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "123", "test/exceptions.zep", 57); return; } if (ZEPHIR_IS_STRING(type, "double")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "123.123", "test/exceptions.zep", 59); return; } } while(0); ZEPHIR_MM_RESTORE();}
开发者ID:alessiot25,项目名称:zephir,代码行数:33,
示例2: PHP_METHOD/* {{{ MongoDB::__construct */PHP_METHOD(MongoDB, __construct) { zval *zlink; char *name; int name_len; mongo_db *db; mongo_link *link; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &zlink, mongo_ce_Mongo, &name, &name_len) == FAILURE) { zval *object = getThis(); ZVAL_NULL(object); return; } if (0 == name_len || 0 != strchr(name, ' ') || 0 != strchr(name, '.') || 0 != strchr(name, '//') || 0 != strchr(name, '/') || 0 != strchr(name, '$')) {#if ZEND_MODULE_API_NO >= 20060613 zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "MongoDB::__construct(): invalid name %s", name);#else zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "MongoDB::__construct(): invalid name %s", name);#endif /* ZEND_MODULE_API_NO >= 20060613 */ return; } db = (mongo_db*)zend_object_store_get_object(getThis() TSRMLS_CC); db->link = zlink; zval_add_ref(&db->link); PHP_MONGO_GET_LINK(zlink); db->slave_okay = link->slave_okay; MAKE_STD_ZVAL(db->name); ZVAL_STRING(db->name, name, 1);}
开发者ID:cockatoo-org,项目名称:mongo-php-driver,代码行数:37,
示例3: PHP_METHODPHP_METHOD(Test_TryTest, testTry8) { int ZEPHIR_LAST_CALL_STATUS; zval *_0, *_1; ZEPHIR_MM_GROW(); /* try_start_1: */ ZEPHIR_INIT_VAR(_0); object_init_ex(_0, zend_exception_get_default(TSRMLS_C)); ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "error 1!", 0); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, _1); zephir_check_temp_parameter(_1); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(_0, "test/trytest.zep", 111 TSRMLS_CC); goto try_end_1; try_end_1: zend_clear_exception(TSRMLS_C); ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "error 2!", "test/trytest.zep", 113); return;}
开发者ID:LegendZhu,项目名称:zephir,代码行数:28,
示例4: PHP_RINIT_FUNCTION/* {{{ PHP_RINIT_FUNCTION */static PHP_RINIT_FUNCTION(uopz){ zend_class_entry *ce = NULL; zend_string *spl;#ifdef ZTS ZEND_TSRMLS_CACHE_UPDATE();#endif spl = zend_string_init(ZEND_STRL("RuntimeException"), 0); spl_ce_RuntimeException = (ce = zend_lookup_class(spl)) ? ce : zend_exception_get_default(); zend_string_release(spl); spl = zend_string_init(ZEND_STRL("InvalidArgumentException"), 0); spl_ce_InvalidArgumentException = (ce = zend_lookup_class(spl)) ? ce : zend_exception_get_default(); zend_string_release(spl); uopz_request_init(); return SUCCESS;} /* }}} */
开发者ID:remicollet,项目名称:uopz,代码行数:27,
示例5: init_couchbase_exceptionsPHP_COUCHBASE_LOCALvoid init_couchbase_exceptions(TSRMLS_D){ zend_class_entry *root;#if ZEND_MODULE_API_NO >= 20060613 root = (zend_class_entry *)zend_exception_get_default(TSRMLS_C);#else root = (zend_class_entry *)zend_exception_get_default();#endif setup(cb_exception, "CouchbaseException", root); setup(cb_illegal_key_exception, "CouchbaseIllegalKeyException", cb_exception); setup(cb_no_such_key_exception, "CouchbaseNoSuchKeyException", cb_exception); setup(cb_auth_exception, "CouchbaseAuthenticationException", cb_exception); setup(cb_lcb_exception, "CouchbaseLibcouchbaseException", cb_exception); setup(cb_server_exception, "CouchbaseServerException", cb_exception); setup(cb_key_mutated_exception, "CouchbaseKeyMutatedException", cb_exception); setup(cb_timeout_exception, "CouchbaseTimeoutException", cb_exception); setup(cb_not_enough_nodes_exception, "CouchbaseNotEnoughNodesException", cb_exception); setup(cb_illegal_option_exception, "CouchbaseIllegalOptionException", cb_exception); setup(cb_illegal_value_exception, "CouchbaseIllegalValueException", cb_exception); setup(cb_illegal_arguments_exception, "CouchbaseIllegalArgumentsException", cb_exception); setup(cb_not_supported_exception, "CouchbaseNotSupportedException", cb_exception);}
开发者ID:AditiAvalkar-GSLab,项目名称:php-ext-couchbase,代码行数:33,
示例6: zephir_throw_exception_debug/** * Throws a zval object as exception */void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line){ zend_class_entry *default_exception_ce; int ZEPHIR_LAST_CALL_STATUS = 0; zval curline; zval object_copy; ZVAL_UNDEF(&curline); ZEPHIR_MM_GROW(); if (Z_TYPE_P(object) != IS_OBJECT) { ZVAL_COPY_VALUE(&object_copy, object); object_init_ex(object, zend_exception_get_default()); ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, &object_copy); zval_ptr_dtor(&object_copy); } Z_ADDREF_P(object); if (line > 0) { ZEPHIR_CALL_METHOD(&curline, object, "getline", NULL, 0); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&curline, 0)) { default_exception_ce = zend_exception_get_default(); zend_update_property_string(default_exception_ce, object, SL("file"), file); zend_update_property_long(default_exception_ce, object, SL("line"), line); } } if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { zend_throw_exception_object(object); } ZEPHIR_MM_RESTORE();}
开发者ID:KorsaR-ZN,项目名称:zephir,代码行数:38,
示例7: sizeofPHP_TARANTOOL_APIzend_class_entry *php_tarantool_get_exception_base(int root TSRMLS_DC){#if HAVE_SPL if (!root) { if (!spl_ce_RuntimeException) { zend_class_entry **pce; if (zend_hash_find(CG(class_table), "runtimeexception", sizeof("RuntimeException"), (void **) &pce) == SUCCESS) { spl_ce_RuntimeException = *pce; return *pce; } } else { return spl_ce_RuntimeException; } }#endif#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2) return zend_exception_get_default();#else return zend_exception_get_default(TSRMLS_C);#endif}
开发者ID:baltazor5000,项目名称:tarantool-php,代码行数:25,
示例8: phpg_register_exceptionsvoid phpg_register_exceptions(){ zend_class_entry ce; TSRMLS_FETCH(); INIT_CLASS_ENTRY(ce, "PhpGtkException", NULL);#if ZEND_EXTENSION_API_NO > 220051025 phpg_generic_exception = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC);#else phpg_generic_exception = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC);#endif phpg_generic_exception->ce_flags |= ZEND_ACC_FINAL; phpg_generic_exception->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; INIT_CLASS_ENTRY(ce, "PhpGtkConstructException", NULL); phpg_construct_exception = zend_register_internal_class_ex(&ce, phpg_generic_exception, NULL TSRMLS_CC); phpg_construct_exception->ce_flags |= ZEND_ACC_FINAL; phpg_construct_exception->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; INIT_CLASS_ENTRY(ce, "PhpGtkTypeException", NULL); phpg_type_exception = zend_register_internal_class_ex(&ce, phpg_generic_exception, NULL TSRMLS_CC); phpg_type_exception->ce_flags |= ZEND_ACC_FINAL; phpg_type_exception->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; INIT_CLASS_ENTRY(ce, "PhpGtkGErrorException", NULL); phpg_gerror_exception = zend_register_internal_class_ex(&ce, phpg_generic_exception, NULL TSRMLS_CC); phpg_gerror_exception->ce_flags |= ZEND_ACC_FINAL; phpg_gerror_exception->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; zend_declare_property_string(phpg_gerror_exception, "domain", sizeof("domain")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); zend_declare_property_string(phpg_gerror_exception, "message", sizeof("message")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); zend_declare_property_string(phpg_gerror_exception, "code", sizeof("code")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);}
开发者ID:afaolek,项目名称:php-gtk-src,代码行数:32,
示例9: PHP_METHODPHP_METHOD(Test_TryTest, testTry4) { zephir_nts_static zephir_fcall_cache_entry *_2 = NULL, *_3 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *a_param = NULL, *_0 = NULL, *_1 = NULL; zend_bool a; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &a_param); a = zephir_get_boolval(a_param); /* try_start_1: */ if (a) { ZEPHIR_INIT_VAR(_0); object_init_ex(_0, zend_exception_get_default(TSRMLS_C)); ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "error!", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", &_2, _1); zephir_check_temp_parameter(_1); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(_0, "test/trytest.zep", 46 TSRMLS_CC); goto try_end_1; } else { ZEPHIR_INIT_NVAR(_0); object_init_ex(_0, spl_ce_RuntimeException); ZEPHIR_INIT_NVAR(_1); ZVAL_STRING(_1, "error!", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", &_3, _1); zephir_check_temp_parameter(_1); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(_0, "test/trytest.zep", 48 TSRMLS_CC); goto try_end_1; } try_end_1: if (EG(exception)) { ZEPHIR_INIT_NVAR(_0); ZEPHIR_CPY_WRT(_0, EG(exception)); if (zephir_instance_of_ev(_0, spl_ce_RuntimeException TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); RETURN_MM_STRING("domain error", 1); } ZEPHIR_INIT_NVAR(_0); ZEPHIR_CPY_WRT(_0, EG(exception)); if (zephir_instance_of_ev(_0, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); RETURN_MM_STRING("error", 1); } } RETURN_MM_BOOL(0);}
开发者ID:AveVlad,项目名称:zephir,代码行数:59,
示例10: PHP_METHODPHP_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);}
开发者ID:sailthru,项目名称:mongo-php-driver,代码行数:59,
示例11: couchbase_init_exceptionsvoid couchbase_init_exceptions(INIT_FUNC_ARGS) {#if ZEND_MODULE_API_NO >= 20060613 default_exception_ce = (zend_class_entry *)zend_exception_get_default(TSRMLS_C);#else default_exception_ce = (zend_class_entry *)zend_exception_get_default();#endif setup(cb_exception_ce, "CouchbaseException", default_exception_ce);}
开发者ID:Ramzi-Alqrainy,项目名称:php-couchbase,代码行数:9,
示例12: php_message/* Iterate over the given php zval** and transform into protobuf compatible values. Write those into the given protobuf message pointer. */intphp_message (const ProtobufCMessage* message, zval* val){ HashPosition pos; HashTable* hash_table = Z_ARRVAL_P(val); zval** data; char* key; int i, j, key_len; long index; // check if all required fields are existent in the given php array. // NULL default values if not for (j=0 ; j < message->descriptor->n_fields ; ++j) { const ProtobufCFieldDescriptor* tmp_field = message->descriptor->fields + j; if (! zend_symtable_exists(hash_table, (char*)tmp_field->name, strlen((char*)(tmp_field->name)) + 1)) { if (tmp_field->label == PROTOBUF_C_LABEL_REQUIRED) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "cannot find required field '%s'", tmp_field->name); return 1; } else { null_field(message, tmp_field); } } } // copy php values to proto zend_hash_internal_pointer_reset_ex(hash_table, &pos); for (;; zend_hash_move_forward_ex(hash_table, &pos)) { zend_hash_get_current_data_ex(hash_table, (void**)&data, &pos); i = zend_hash_get_current_key_ex(hash_table, &key, &key_len, &index, 0, &pos); if (i == HASH_KEY_NON_EXISTANT) { break; } else if (i == HASH_KEY_IS_STRING) { const ProtobufCFieldDescriptor* field = find_field(message, key); if (field == NULL) continue; if (write_field(message, field, data) != 0) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "unable to pack field '%s'", field->name); return 1; } } } return 0;}
开发者ID:zined,项目名称:phproto,代码行数:54,
示例13: PHP_METHODPHP_METHOD(MongoCollection, __construct) { zval *parent, *name, *zns, *w, *wtimeout; mongo_collection *c; mongo_db *db; char *ns, *name_str; int name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &parent, mongo_ce_DB, &name_str, &name_len) == FAILURE) { zval *object = getThis(); ZVAL_NULL(object); return; } // check for empty collection name if (name_len == 0) {#if ZEND_MODULE_API_NO >= 20060613 zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "MongoDB::__construct(): invalid name %s", name_str);#else zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "MongoDB::__construct(): invalid name %s", name_str);#endif /* ZEND_MODULE_API_NO >= 20060613 */ return; } c = (mongo_collection*)zend_object_store_get_object(getThis() TSRMLS_CC); PHP_MONGO_GET_DB(parent); c->link = db->link; zval_add_ref(&db->link); c->parent = parent; zval_add_ref(&parent); MAKE_STD_ZVAL(name); ZVAL_STRINGL(name, name_str, name_len, 1); c->name = name; spprintf(&ns, 0, "%s.%s", Z_STRVAL_P(db->name), Z_STRVAL_P(name)); MAKE_STD_ZVAL(zns); ZVAL_STRING(zns, ns, 0); c->ns = zns; mongo_read_preference_copy(&db->read_pref, &c->read_pref); w = zend_read_property(mongo_ce_DB, parent, "w", strlen("w"), NOISY TSRMLS_CC); zend_update_property_long(mongo_ce_Collection, getThis(), "w", strlen("w"), Z_LVAL_P(w) TSRMLS_CC); wtimeout = zend_read_property(mongo_ce_DB, parent, "wtimeout", strlen("wtimeout"), NOISY TSRMLS_CC); zend_update_property_long(mongo_ce_Collection, getThis(), "wtimeout", strlen("wtimeout"), Z_LVAL_P(wtimeout) TSRMLS_CC);}
开发者ID:okanyedibela,项目名称:mongo-php-driver,代码行数:49,
示例14: PHP_METHOD/** * Dispatches a handle action taking into account the routing parameters * * @return object */PHP_METHOD(Phalcon_Dispatcher, dispatch) { zval *handler = NULL, *e = NULL, *_0$$4 = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); /* try_start_1: */ ZEPHIR_CALL_METHOD(&handler, this_ptr, "_dispatch", NULL, 0); zephir_check_call_status_or_jump(try_end_1); try_end_1: if (EG(exception)) { ZEPHIR_CPY_WRT(e, EG(exception)); if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); ZEPHIR_CALL_METHOD(&_0$$4, this_ptr, "_handleexception", NULL, 0, e); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$4)) { RETURN_MM_BOOL(0); } zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 348 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } RETURN_CCTOR(handler);}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:37,
示例15: PHP_METHODPHP_METHOD(Test_Exceptions, testExceptionRethrow) { zval e; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_INIT_THIS(); ZVAL_UNDEF(&e); ZEPHIR_MM_GROW(); /* try_start_1: */ ZEPHIR_CALL_METHOD(NULL, this_ptr, "testexception1", NULL, 0); zephir_check_call_status_or_jump(try_end_1); try_end_1: if (EG(exception)) { ZVAL_OBJ(&e, EG(exception)); Z_ADDREF_P(&e); if (zephir_instance_of_ev(&e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); zephir_throw_exception_debug(&e, "test/exceptions.zep", 80 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } ZEPHIR_MM_RESTORE();}
开发者ID:8V017UW2RQ70,项目名称:zephir,代码行数:31,
示例16: create_struct_exvoid create_struct_ex(zval *retval, Any *anyval, char *str, int str_len TSRMLS_DC){ Reference <XIdlReflection> *x_idl_reflec_p; int type; int rsrc_id; try { //restore XIdlReflection resource x_idl_reflec_p = (Reference <XIdlReflection> *) zend_list_find( PUNO_G(x_idl_reflec_rsrc_id),&type); TEST_PTR(x_idl_reflec_p,); Reference <XIdlClass> xIdlClass = (*x_idl_reflec_p)->forName(OUString(str,str_len,RTL_TEXTENCODING_ISO_8859_15,OSTRING_TO_OUSTRING_CVTFLAGS)); TEST_PTR(xIdlClass.is(),); //Reference <XIdlField2> field (xidlfield, UNO_QUERY); Any any_obj; xIdlClass->createObject(any_obj); if(anyval!=NULL) { any_obj.setValue((*anyval).getValue(),(*anyval).getValueType()); } Any *any_obj_p= new Any(any_obj); TEST_PTR(any_obj_p,); //init object object_init_ex (retval, ce_ptr); puno_class_object *new_struct_p; new_struct_p = (puno_class_object *) zend_object_store_get_object(retval TSRMLS_CC); TEST_PTR(new_struct_p,); //type is Structs new_struct_p->type = TypeClass_STRUCT; //register and store the Any object rsrc_id = ZEND_REGISTER_RESOURCE ( NULL, any_obj_p, uno_any_rsrc_dtor); TEST_PTR(rsrc_id,); new_struct_p->this_rsrc_id = rsrc_id; //register and store the XIdlClass Interface Reference <XIdlClass> *x_idl_class_p=new Reference <XIdlClass> (xIdlClass); TEST_PTR(x_idl_class_p,); rsrc_id = ZEND_REGISTER_RESOURCE ( NULL, x_idl_class_p, uno_refer_rsrc_dtor); TEST_PTR(rsrc_id,); new_struct_p->x_idl_class_rsrc_id = rsrc_id; } catch(Exception& e) { //throw PHP EXCEPTION zend_throw_exception(zend_exception_get_default(),(char *)OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr(),0 TSRMLS_CC); }}
开发者ID:adjohu,项目名称:puno,代码行数:60,
示例17: PHP_METHODPHP_METHOD(Test_TryTest, testTry2) { int ZEPHIR_LAST_CALL_STATUS; zval *_0, *_1; ZEPHIR_MM_GROW(); /* try_start_1: */ ZEPHIR_INIT_VAR(_0); object_init_ex(_0, zend_exception_get_default(TSRMLS_C)); ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "error!", 0); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, _1); zephir_check_temp_parameter(_1); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception(_0 TSRMLS_CC); goto try_end_1; try_end_1: zend_clear_exception(TSRMLS_C); ZEPHIR_MM_RESTORE();}
开发者ID:javierfortea,项目名称:zephir,代码行数:27,
示例18: PHP_METHODPHP_METHOD(Test_TryTest, testTry2) { zval _0$$3, _1$$3; int ZEPHIR_LAST_CALL_STATUS; zval this_zv; zval *this_ptr = getThis(); if (EXPECTED(this_ptr)) { ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr)); this_ptr = &this_zv; } else this_ptr = NULL; ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); /* try_start_1: */ ZEPHIR_INIT_VAR(&_0$$3); object_init_ex(&_0$$3, zend_exception_get_default(TSRMLS_C)); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "error!"); ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 24, &_1$$3); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_0$$3, "test/trytest.zep", 27 TSRMLS_CC); goto try_end_1; try_end_1: zend_clear_exception(TSRMLS_C);}
开发者ID:Mrhjx2,项目名称:zephir,代码行数:34,
示例19: PHP_METHODPHP_METHOD(Lynx_DBAL_Driver_PgSQL, prepare) { int ZEPHIR_LAST_CALL_STATUS; zval *statement, *e = NULL, *_0, *_1 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statement); ZEPHIR_CALL_METHOD(NULL, this_ptr, "connect", NULL); zephir_check_call_status(); /* try_start_1: */ _0 = zephir_fetch_nproperty_this(this_ptr, SL("connection"), PH_NOISY_CC); ZEPHIR_RETURN_CALL_METHOD(_0, "prepare", NULL, statement); zephir_check_call_status_or_jump(try_end_1); RETURN_MM(); try_end_1: if (EG(exception)) { ZEPHIR_CPY_WRT(e, EG(exception)); if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); ZEPHIR_CALL_METHOD(&_1, e, "getmessage", NULL); zephir_check_call_status(); zephir_var_dump(&_1 TSRMLS_CC); zephir_exit_empty(); ZEPHIR_MM_RESTORE(); } }}
开发者ID:Green-Cat,项目名称:lynx,代码行数:35,
示例20: PHP_METHODPHP_METHOD(Test_Exceptions, issue1325) { zval e, status, _0; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_UNDEF(&e); ZVAL_UNDEF(&status); ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); /* try_start_1: */ ZEPHIR_CALL_METHOD(&status, this_ptr, "donoopexception", NULL, 27); zephir_check_call_status_or_jump(try_end_1); try_end_1: if (EG(exception)) { ZEPHIR_INIT_VAR(&_0); ZVAL_OBJ(&_0, EG(exception)); Z_ADDREF_P(&_0); if (zephir_instance_of_ev(&_0, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); ZEPHIR_CPY_WRT(&e, &_0); ZEPHIR_INIT_NVAR(&status); ZVAL_STRING(&status, "woop"); } } RETURN_MM_LONG(1);}
开发者ID:dreamsxin,项目名称:zephir,代码行数:34,
示例21: PHP_METHODPHP_METHOD(Configman_BaseServiceConfig, __construct) { int ZEPHIR_LAST_CALL_STATUS; zval *service_param = NULL, _0, *_1 = NULL, *_2; zval *service = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &service_param); zephir_get_strval(service, service_param); zephir_update_property_this(this_ptr, SL("service"), service TSRMLS_CC); ZEPHIR_SINIT_VAR(_0); ZVAL_STRING(&_0, "configman.config_path", 0); ZEPHIR_CALL_FUNCTION(&_1, "ini_get", NULL, 1, &_0); zephir_check_call_status(); zephir_update_property_this(this_ptr, SL("config_path"), _1 TSRMLS_CC); _2 = zephir_fetch_nproperty_this(this_ptr, SL("config_path"), PH_NOISY_CC); if (!(zephir_is_true(_2))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "config item configman.config_path error!", "configman/BaseServiceConfig.zep", 14); return; } ZEPHIR_MM_RESTORE();}
开发者ID:wchswchs,项目名称:configman_php_extension,代码行数:26,
注:本文中的zend_exception_get_default函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zend_fetch_class函数代码示例 C++ zend_call_function函数代码示例 |