这篇教程C++ zend_hash_destroy函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zend_hash_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ zend_hash_destroy函数的具体用法?C++ zend_hash_destroy怎么用?C++ zend_hash_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zend_hash_destroy函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: zend_shutdown_constantsint zend_shutdown_constants(void){ zend_hash_destroy(EG(zend_constants)); free(EG(zend_constants)); return SUCCESS;}
开发者ID:0xhacking,项目名称:php-src,代码行数:6,
示例2: PHP_METHOD/** * Unregisters one or all listeners for an event. * * @param string|/Xpl/Event/Event event Event ID or object. * @param callable callback [Optional] Callback to remove. If no callback is given, * then all of the event's listeners are removed. * @return /Xpl/Event/Manager * * @throws /InvalidArgumentException if event is not a string or Event instance. */PHP_METHOD(Xpl_Event_Manager, off) { HashTable *_6$$8; HashPosition _5$$8; int ZEPHIR_LAST_CALL_STATUS; zval *event, *callback = NULL, *id = NULL, *listeners = NULL, *_4, *_0$$4, *_1$$5, *_2$$5, *_3$$5, *i$$8 = NULL, *listener$$8 = NULL, **_7$$8, *_8$$9 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &event, &callback); if (!callback) { callback = ZEPHIR_GLOBAL(global_null); } if (Z_TYPE_P(event) == IS_STRING) { ZEPHIR_CPY_WRT(id, event); } else if (zephir_instance_of_ev(event, xpl_event_event_ce TSRMLS_CC)) { ZEPHIR_OBS_VAR(_0$$4); zephir_read_property(&_0$$4, event, SL("id"), PH_NOISY_CC); ZEPHIR_CPY_WRT(id, _0$$4); } else { ZEPHIR_INIT_VAR(_1$$5); object_init_ex(_1$$5, spl_ce_InvalidArgumentException); ZEPHIR_INIT_VAR(_2$$5); zephir_gettype(_2$$5, event TSRMLS_CC); ZEPHIR_INIT_VAR(_3$$5); ZEPHIR_CONCAT_SV(_3$$5, "Event must be string or instance of Event, given: ", _2$$5); ZEPHIR_CALL_METHOD(NULL, _1$$5, "__construct", NULL, 5, _3$$5); zephir_check_call_status(); zephir_throw_exception_debug(_1$$5, "xpl/event/manager.zep", 118 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_VAR(listeners); _4 = zephir_fetch_nproperty_this(this_ptr, SL("listeners"), PH_NOISY_CC); if (zephir_array_isset_fetch(&listeners, _4, id, 0 TSRMLS_CC)) { if (Z_TYPE_P(callback) == IS_NULL) { zephir_array_unset(&listeners, id, PH_SEPARATE); } else { zephir_is_iterable(listeners, &_6$$8, &_5$$8, 1, 0, "xpl/event/manager.zep", 137); for ( ; zephir_hash_get_current_data_ex(_6$$8, (void**) &_7$$8, &_5$$8) == SUCCESS ; zephir_hash_move_forward_ex(_6$$8, &_5$$8) ) { ZEPHIR_GET_HMKEY(i$$8, _6$$8, _5$$8); ZEPHIR_GET_HVALUE(listener$$8, _7$$8); ZEPHIR_OBS_NVAR(_8$$9); zephir_read_property(&_8$$9, listener$$8, SL("callback"), PH_NOISY_CC); if (ZEPHIR_IS_EQUAL(callback, _8$$9)) { zephir_array_unset(&listeners, i$$8, PH_SEPARATE); } } zend_hash_destroy(_6$$8); FREE_HASHTABLE(_6$$8); } zephir_update_property_array(this_ptr, SL("listeners"), id, listeners TSRMLS_CC); } RETURN_THIS();}
开发者ID:wells5609,项目名称:xpl,代码行数:71,
示例3: php_output_shutdown/* {{{ void php_output_shutdown(void) * Destroy module globals and the conflict and reverse conflict hash tables */PHPAPI void php_output_shutdown(void){ zend_hash_destroy(&php_output_handler_aliases); zend_hash_destroy(&php_output_handler_conflicts); zend_hash_destroy(&php_output_handler_reverse_conflicts);}
开发者ID:azatoth,项目名称:php-src,代码行数:8,
示例4: php_can_strtr_arrayzval * php_can_strtr_array(char *str, int slen, HashTable *hash){ zval **entry; char *string_key; uint string_key_len; zval **trans; zval ctmp; ulong num_key; int minlen = 128*1024; int maxlen = 0, pos, len, found; char *key; HashPosition hpos; smart_str result = {0}; HashTable tmp_hash; zend_hash_init(&tmp_hash, zend_hash_num_elements(hash), NULL, NULL, 0); zend_hash_internal_pointer_reset_ex(hash, &hpos); while (zend_hash_get_current_data_ex(hash, (void **)&entry, &hpos) == SUCCESS) { switch (zend_hash_get_current_key_ex(hash, &string_key, &string_key_len, &num_key, 0, &hpos)) { case HASH_KEY_IS_STRING: len = string_key_len-1; if (len < 1) { zend_hash_destroy(&tmp_hash); return NULL; } zend_hash_add(&tmp_hash, string_key, string_key_len, entry, sizeof(zval*), NULL); if (len > maxlen) { maxlen = len; } if (len < minlen) { minlen = len; } break; case HASH_KEY_IS_LONG: Z_TYPE(ctmp) = IS_LONG; Z_LVAL(ctmp) = num_key; convert_to_string(&ctmp); len = Z_STRLEN(ctmp); zend_hash_add(&tmp_hash, Z_STRVAL(ctmp), len+1, entry, sizeof(zval*), NULL); zval_dtor(&ctmp); if (len > maxlen) { maxlen = len; } if (len < minlen) { minlen = len; } break; } zend_hash_move_forward_ex(hash, &hpos); } key = emalloc(maxlen+1); pos = 0; while (pos < slen) { if ((pos + maxlen) > slen) { maxlen = slen - pos; } found = 0; memcpy(key, str+pos, maxlen); for (len = maxlen; len >= minlen; len--) { key[len] = 0; if (zend_hash_find(&tmp_hash, key, len+1, (void**)&trans) == SUCCESS) { char *tval; int tlen; zval tmp; if (Z_TYPE_PP(trans) != IS_STRING) { tmp = **trans; zval_copy_ctor(&tmp); convert_to_string(&tmp); tval = Z_STRVAL(tmp); tlen = Z_STRLEN(tmp); } else { tval = Z_STRVAL_PP(trans); tlen = Z_STRLEN_PP(trans); } smart_str_appendl(&result, tval, tlen); pos += len; found = 1; if (Z_TYPE_PP(trans) != IS_STRING) { zval_dtor(&tmp); } break; } } if (! found) { smart_str_appendc(&result, str[pos++]); } }//.........这里部分代码省略.........
开发者ID:MaxMillion,项目名称:phpcan,代码行数:101,
示例5: PHP_METHOD/** * Updates data on a table using custom RBDM SQL syntax * * @param string $table * @param array $fields * @param array $values * @param string $whereCondition * @return boolean */PHP_METHOD(Phalcon_Db, update){ zval *table = NULL, *fields = NULL, *values = NULL, *where_condition = NULL; zval *placeholders = NULL, *value = NULL, *position = NULL, *field = NULL, *set_clause_part = NULL; zval *comma = NULL, *set_clause = NULL, *update_sql = NULL, *success = NULL; HashTable *ah0; HashPosition hp0; zval **hd; char *hash_index; uint hash_index_len; ulong hash_num; int hash_type; int eval_int; PHALCON_MM_GROW(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z", &table, &fields, &values, &where_condition) == FAILURE) { PHALCON_MM_RESTORE(); RETURN_NULL(); } PHALCON_SEPARATE_PARAM(values); if (!where_condition) { PHALCON_ALLOC_ZVAL_MM(where_condition); ZVAL_NULL(where_condition); } PHALCON_INIT_VAR(placeholders); array_init(placeholders); if (!phalcon_valid_foreach(values TSRMLS_CC)) { return; } ALLOC_HASHTABLE(ah0); zend_hash_init(ah0, 0, NULL, NULL, 0); zend_hash_copy(ah0, Z_ARRVAL_P(values), NULL, NULL, sizeof(zval*)); zend_hash_internal_pointer_reset_ex(ah0, &hp0); ph_cycle_start_0: if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){ goto ph_cycle_end_0; } PHALCON_INIT_VAR(position); PHALCON_GET_FOREACH_KEY(position, ah0, hp0); PHALCON_GET_FOREACH_VALUE(value); eval_int = phalcon_array_isset(fields, position); if (eval_int) { PHALCON_INIT_VAR(field); phalcon_array_fetch(&field, fields, position, PH_NOISY_CC); if (Z_TYPE_P(value) == IS_OBJECT) { PHALCON_INIT_VAR(set_clause_part); PHALCON_CONCAT_VSV(set_clause_part, field, " = ", value); phalcon_array_append(&placeholders, set_clause_part, PH_SEPARATE TSRMLS_CC); PHALCON_SEPARATE_PARAM(values); phalcon_array_unset(values, position); } else { if (Z_TYPE_P(value) == IS_NULL) { PHALCON_INIT_VAR(set_clause_part); PHALCON_CONCAT_VS(set_clause_part, field, " = null"); PHALCON_SEPARATE_PARAM(values); phalcon_array_unset(values, position); } else { PHALCON_INIT_VAR(set_clause_part); PHALCON_CONCAT_VS(set_clause_part, field, " = ?"); } phalcon_array_append(&placeholders, set_clause_part, PH_SEPARATE TSRMLS_CC); } } else { PHALCON_THROW_EXCEPTION_STR(phalcon_db_exception_ce, "The number of values in the update is not the same as fields"); return; } zend_hash_move_forward_ex(ah0, &hp0); goto ph_cycle_start_0; ph_cycle_end_0: zend_hash_destroy(ah0); efree(ah0); PHALCON_INIT_VAR(comma); ZVAL_STRING(comma, ", ", 1); PHALCON_INIT_VAR(set_clause); phalcon_fast_join(set_clause, comma, placeholders TSRMLS_CC); if (Z_TYPE_P(where_condition) != IS_NULL) { PHALCON_INIT_VAR(update_sql);//.........这里部分代码省略.........
开发者ID:logicode,项目名称:cphalcon,代码行数:101,
示例6: zend_shared_alloc_destroy_xlat_tablevoid zend_shared_alloc_destroy_xlat_table(void){ /* Destroy translation table */ zend_hash_destroy(&ZCG(xlat_table));}
开发者ID:AxiosCros,项目名称:php-src,代码行数:5,
示例7: zend_interned_strings_deactivateZEND_API void zend_interned_strings_deactivate(void){ zend_hash_destroy(&CG(interned_strings));}
开发者ID:eaglewu,项目名称:php-src,代码行数:4,
示例8: umsg_get_numeric_types//.........这里部分代码省略......... continue; } } } else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) { int32_t argNumber = name_part.getValue(); if (argNumber < 0) { intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Found part with negative number", 0); continue; } if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (zend_ulong)argNumber)) == NULL) { /* not found already; create new entry in HT */ Formattable::Type bogusType = Formattable::kObject; if ((storedType = (Formattable::Type*)zend_hash_index_update_mem(ret, (zend_ulong)argNumber, (void*)&bogusType, sizeof(bogusType))) == NULL) { intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR, "Write to argument types hash table failed", 0); continue; } } } else { intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0); continue; } UMessagePatternArgType argType = p.getArgType(); /* No type specified, treat it as a string */ if (argType == UMSGPAT_ARG_TYPE_NONE) { type = Formattable::kString; } else { /* Some type was specified, might be simple or complicated */ if (argType == UMSGPAT_ARG_TYPE_SIMPLE) { /* For a SIMPLE arg, after the name part, there should be * an ARG_TYPE part whose string value tells us what to do */ MessagePattern::Part type_part = mp.getPart(++i); /* Getting type, advancing i */ if (type_part.getType() == UMSGPAT_PART_TYPE_ARG_TYPE) { UnicodeString typeString = mp.getSubstring(type_part); /* This is all based on the rules in the docs for MessageFormat * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */ if (typeString == "number") { MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */ if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) { UnicodeString styleString = mp.getSubstring(style_part); if (styleString == "integer") { type = Formattable::kInt64; } else if (styleString == "currency") { type = Formattable::kDouble; } else if (styleString == "percent") { type = Formattable::kDouble; } else { /* some style invalid/unknown to us */ type = Formattable::kDouble; } } else { // if missing style, part, make it a double type = Formattable::kDouble; } } else if ((typeString == "date") || (typeString == "time")) { type = Formattable::kDate; } else if ((typeString == "spellout") || (typeString == "ordinal") || (typeString == "duration")) { type = Formattable::kDouble; } } else { /* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern * is broken. */ intl_errors_set(&err, U_PARSE_ERROR, "Expected UMSGPAT_PART_TYPE_ARG_TYPE part following " "UMSGPAT_ARG_TYPE_SIMPLE part", 0); continue; } } else if (argType == UMSGPAT_ARG_TYPE_PLURAL) { type = Formattable::kDouble; } else if (argType == UMSGPAT_ARG_TYPE_CHOICE) { type = Formattable::kDouble; } else if (argType == UMSGPAT_ARG_TYPE_SELECT) { type = Formattable::kString; } else { type = Formattable::kString; } } /* was type specified? */ /* We found a different type for the same arg! */ if (*storedType != Formattable::kObject && *storedType != type) { intl_errors_set(&err, U_ARGUMENT_TYPE_MISMATCH, "Inconsistent types declared for an argument", 0); continue; } *storedType = type; } /* visiting each part */ if (U_FAILURE(err.code)) { zend_hash_destroy(ret); efree(ret); return NULL; } mfo->mf_data.arg_types = ret; return ret;}
开发者ID:13572293130,项目名称:php-src,代码行数:101,
示例9: PHP_METHOD/** * Inserts data into a table using custom RBDM SQL syntax * * @param string $table * @param array $values * @param array $fields * @return boolean */PHP_METHOD(Phalcon_Db, insert){ zval *table = NULL, *values = NULL, *fields = NULL, *placeholders = NULL, *value = NULL; zval *n = NULL, *comma = NULL, *joined_values = NULL, *insert_sql = NULL; zval *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *r4 = NULL; zval *i0 = NULL; HashTable *ah0; HashPosition hp0; zval **hd; char *hash_index; uint hash_index_len; ulong hash_num; int hash_type; PHALCON_MM_GROW(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &table, &values, &fields) == FAILURE) { PHALCON_MM_RESTORE(); RETURN_NULL(); } PHALCON_SEPARATE_PARAM(values); if (!fields) { PHALCON_ALLOC_ZVAL_MM(fields); ZVAL_NULL(fields); } if (Z_TYPE_P(values) == IS_ARRAY) { PHALCON_ALLOC_ZVAL_MM(r0); phalcon_fast_count(r0, values TSRMLS_CC); if (!zend_is_true(r0)) { PHALCON_ALLOC_ZVAL_MM(i0); object_init_ex(i0, phalcon_db_exception_ce); PHALCON_ALLOC_ZVAL_MM(r1); PHALCON_CONCAT_SVS(r1, "Unable to insert into ", table, " without data"); PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", r1, PH_CHECK); phalcon_throw_exception(i0 TSRMLS_CC); return; } PHALCON_INIT_VAR(placeholders); array_init(placeholders); if (!phalcon_valid_foreach(values TSRMLS_CC)) { return; } ALLOC_HASHTABLE(ah0); zend_hash_init(ah0, 0, NULL, NULL, 0); zend_hash_copy(ah0, Z_ARRVAL_P(values), NULL, NULL, sizeof(zval*)); zend_hash_internal_pointer_reset_ex(ah0, &hp0); fes_e7f0_1: if(zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS){ goto fee_e7f0_1; } PHALCON_INIT_VAR(n); PHALCON_GET_FOREACH_KEY(n, ah0, hp0); PHALCON_INIT_VAR(value); ZVAL_ZVAL(value, *hd, 1, 0); if (Z_TYPE_P(value) == IS_OBJECT) { PHALCON_INIT_VAR(r2); PHALCON_CALL_FUNC_PARAMS_1(r2, "strval", value); phalcon_array_append(&placeholders, r2, PH_SEPARATE TSRMLS_CC); PHALCON_SEPARATE_PARAM(values); phalcon_array_unset(values, n); } else { phalcon_array_append_string(&placeholders, SL("?"), PH_SEPARATE TSRMLS_CC); } zend_hash_move_forward_ex(ah0, &hp0); goto fes_e7f0_1; fee_e7f0_1: zend_hash_destroy(ah0); efree(ah0); PHALCON_INIT_VAR(comma); ZVAL_STRING(comma, ", ", 1); PHALCON_INIT_VAR(joined_values); phalcon_fast_join(joined_values, comma, placeholders TSRMLS_CC); if (Z_TYPE_P(fields) == IS_ARRAY) { PHALCON_ALLOC_ZVAL_MM(r3); phalcon_fast_join(r3, comma, fields TSRMLS_CC); PHALCON_INIT_VAR(insert_sql); PHALCON_CONCAT_SVSVSVS(insert_sql, "INSERT INTO ", table, " (", r3, ") VALUES (", joined_values, ")"); } else { PHALCON_INIT_VAR(insert_sql); PHALCON_CONCAT_SVSVS(insert_sql, "INSERT INTO ", table, " VALUES (", joined_values, ")"); } PHALCON_ALLOC_ZVAL_MM(r4); PHALCON_CALL_METHOD_PARAMS_2(r4, this_ptr, "execute", insert_sql, values, PH_NO_CHECK);//.........这里部分代码省略.........
开发者ID:fatihzkaratana,项目名称:cphalcon,代码行数:101,
示例10: mysqlnd_reverse_api_end/* {{{ mysqlnd_reverse_api_end */PHPAPI voidmysqlnd_reverse_api_end(TSRMLS_D){ zend_hash_destroy(&mysqlnd_api_ext_ht);}
开发者ID:899,项目名称:php-src,代码行数:6,
示例11: overloaded_class_dtorstatic void overloaded_class_dtor(oo_class_data *oo_data){ zend_hash_destroy(&oo_data->getters); zend_hash_destroy(&oo_data->setters);}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:5,
示例12: pdo_sqlstate_fini_error_tablevoid pdo_sqlstate_fini_error_table(void){ zend_hash_destroy(&err_hash);}
开发者ID:DaveRandom,项目名称:php-src,代码行数:4,
示例13: zend_shutdownvoid zend_shutdown(void) /* {{{ */{#ifdef ZEND_SIGNALS zend_signal_shutdown();#endif zend_destroy_rsrc_list(&EG(persistent_list)); if (EG(active)) { /* * The order of destruction is important here. * See bugs #65463 and 66036. */ zend_function *func; zend_class_entry *ce; ZEND_HASH_REVERSE_FOREACH_PTR(GLOBAL_FUNCTION_TABLE, func) { if (func->type == ZEND_USER_FUNCTION) { zend_cleanup_op_array_data((zend_op_array *) func); } } ZEND_HASH_FOREACH_END(); ZEND_HASH_REVERSE_FOREACH_PTR(GLOBAL_CLASS_TABLE, ce) { if (ce->type == ZEND_USER_CLASS) { zend_cleanup_user_class_data(ce); } else { break; } } ZEND_HASH_FOREACH_END(); zend_cleanup_internal_classes(); zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full); zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full); } zend_destroy_modules(); virtual_cwd_deactivate(); virtual_cwd_shutdown(); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE); free(GLOBAL_AUTO_GLOBALS_TABLE); zend_shutdown_extensions(); free(zend_version_info); free(GLOBAL_FUNCTION_TABLE); free(GLOBAL_CLASS_TABLE); zend_hash_destroy(GLOBAL_CONSTANTS_TABLE); free(GLOBAL_CONSTANTS_TABLE); zend_shutdown_strtod();#ifdef ZTS GLOBAL_FUNCTION_TABLE = NULL; GLOBAL_CLASS_TABLE = NULL; GLOBAL_AUTO_GLOBALS_TABLE = NULL; GLOBAL_CONSTANTS_TABLE = NULL;#endif zend_destroy_rsrc_list_dtors(); zend_interned_strings_dtor();}
开发者ID:mdesign83,项目名称:php-src,代码行数:62,
示例14: PHP_METHOD/** * We have to cast values manually because parse_ini_file() has a poor implementation. * * @param mixed ini The array casted by `parse_ini_file` */PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) { zend_bool _5$$5, _6$$5, _8$$5, _9$$5; HashTable *_1$$3; HashPosition _0$$3; zephir_fcall_cache_entry *_4 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *ini, *key = NULL, *val = NULL, **_2$$3, *_3$$4 = NULL, *_7$$5, *_10$$5, *_11$$9, *_12$$9, _13$$9; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &ini); ZEPHIR_SEPARATE_PARAM(ini); if (Z_TYPE_P(ini) == IS_ARRAY) { zephir_is_iterable(ini, &_1$$3, &_0$$3, 1, 0, "phalcon/config/adapter/ini.zep", 134); for ( ; zephir_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS ; zephir_hash_move_forward_ex(_1$$3, &_0$$3) ) { ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); ZEPHIR_GET_HVALUE(val, _2$$3); ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_cast", &_4, 135, val); zephir_check_call_status(); zephir_array_update_zval(&ini, key, &_3$$4, PH_COPY | PH_SEPARATE); } zend_hash_destroy(_1$$3); FREE_HASHTABLE(_1$$3); } if (Z_TYPE_P(ini) == IS_STRING) { _5$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "true"); if (!(_5$$5)) { _5$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "yes"); } _6$$5 = _5$$5; if (!(_6$$5)) { ZEPHIR_INIT_VAR(_7$$5); zephir_fast_strtolower(_7$$5, ini); _6$$5 = ZEPHIR_IS_STRING_IDENTICAL(_7$$5, "on"); } if (_6$$5) { RETURN_MM_BOOL(1); } _8$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "false"); if (!(_8$$5)) { _8$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "no"); } _9$$5 = _8$$5; if (!(_9$$5)) { ZEPHIR_INIT_VAR(_10$$5); zephir_fast_strtolower(_10$$5, ini); _9$$5 = ZEPHIR_IS_STRING_IDENTICAL(_10$$5, "off"); } if (_9$$5) { RETURN_MM_BOOL(0); } if (ZEPHIR_IS_STRING_IDENTICAL(ini, "null")) { RETURN_MM_NULL(); } if (zephir_is_numeric(ini)) { ZEPHIR_INIT_VAR(_11$$9); ZEPHIR_INIT_VAR(_12$$9); ZEPHIR_SINIT_VAR(_13$$9); ZVAL_STRING(&_13$$9, "/[.]+/", 0); zephir_preg_match(_12$$9, &_13$$9, ini, _11$$9, 0, 0 , 0 TSRMLS_CC); if (zephir_is_true(_12$$9)) { RETURN_MM_DOUBLE(zephir_get_doubleval(ini)); } else { RETURN_MM_LONG(zephir_get_intval(ini)); } } } RETVAL_ZVAL(ini, 1, 0); RETURN_MM();}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:82,
示例15: zend_accel_load_scriptzend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory){ zend_op_array *op_array; op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); *op_array = persistent_script->main_op_array; if (EXPECTED(from_shared_memory)) { zend_hash_init(&ZCG(bind_hash), 10, NULL, NULL, 0); ZCG(current_persistent_script) = persistent_script; ZCG(arena_mem) = NULL; if (EXPECTED(persistent_script->arena_size)) {#ifdef __SSE2__ /* Target address must be aligned to 64-byte boundary */ ZCG(arena_mem) = zend_arena_alloc(&CG(arena), persistent_script->arena_size + 64); ZCG(arena_mem) = (void*)(((zend_uintptr_t)ZCG(arena_mem) + 63L) & ~63L); fast_memcpy(ZCG(arena_mem), persistent_script->arena_mem, persistent_script->arena_size);#else ZCG(arena_mem) = zend_arena_alloc(&CG(arena), persistent_script->arena_size); memcpy(ZCG(arena_mem), persistent_script->arena_mem, persistent_script->arena_size);#endif } /* Copy all the necessary stuff from shared memory to regular memory, and protect the shared script */ if (zend_hash_num_elements(&persistent_script->class_table) > 0) { zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, (unique_copy_ctor_func_t) zend_class_copy_ctor); } /* we must first to copy all classes and then prepare functions, since functions may try to bind classes - which depend on pre-bind class entries existent in the class table */ if (zend_hash_num_elements(&persistent_script->function_table) > 0) { zend_accel_function_hash_copy_from_shm(CG(function_table), &persistent_script->function_table); } /* Register __COMPILER_HALT_OFFSET__ constant */ if (persistent_script->compiler_halt_offset != 0 && persistent_script->full_path) { zend_string *name; char haltoff[] = "__COMPILER_HALT_OFFSET__"; name = zend_mangle_property_name(haltoff, sizeof(haltoff) - 1, persistent_script->full_path->val, persistent_script->full_path->len, 0); if (!zend_hash_exists(EG(zend_constants), name)) { zend_register_long_constant(name->val, name->len, persistent_script->compiler_halt_offset, CONST_CS, 0); } zend_string_release(name); } zend_hash_destroy(&ZCG(bind_hash)); ZCG(current_persistent_script) = NULL; } else /* if (!from_shared_memory) */ { if (zend_hash_num_elements(&persistent_script->function_table) > 0) { zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table); } if (zend_hash_num_elements(&persistent_script->class_table) > 0) { zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL); } } if (op_array->early_binding != (uint32_t)-1) { zend_string *orig_compiled_filename = CG(compiled_filename); CG(compiled_filename) = persistent_script->full_path; zend_do_delayed_early_binding(op_array); CG(compiled_filename) = orig_compiled_filename; } if (UNEXPECTED(!from_shared_memory)) { free_persistent_script(persistent_script, 0); /* free only hashes */ } return op_array;}
开发者ID:erikjwaxx,项目名称:php-src,代码行数:71,
示例16: destroy_uploaded_files_hashPHPAPI void destroy_uploaded_files_hash(void) /* {{{ */{ zend_hash_apply(SG(rfc1867_uploaded_files), unlink_filename); zend_hash_destroy(SG(rfc1867_uploaded_files)); FREE_HASHTABLE(SG(rfc1867_uploaded_files));}
开发者ID:sektioneins,项目名称:suhosin7,代码行数:6,
示例17: zend_startupint zend_startup(zend_utility_functions *utility_functions, char **extensions) /* {{{ */{#ifdef ZTS zend_compiler_globals *compiler_globals; zend_executor_globals *executor_globals; extern ZEND_API ts_rsrc_id ini_scanner_globals_id; extern ZEND_API ts_rsrc_id language_scanner_globals_id; ZEND_TSRMLS_CACHE_UPDATE();#else extern zend_ini_scanner_globals ini_scanner_globals; extern zend_php_scanner_globals language_scanner_globals;#endif start_memory_manager(); virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */#if defined(__FreeBSD__) || defined(__DragonFly__) /* FreeBSD and DragonFly floating point precision fix */ fpsetmask(0);#endif zend_startup_strtod(); zend_startup_extensions_mechanism(); /* Set up utility functions and values */ zend_error_cb = utility_functions->error_function; zend_printf = utility_functions->printf_function; zend_write = (zend_write_func_t) utility_functions->write_function; zend_fopen = utility_functions->fopen_function; if (!zend_fopen) { zend_fopen = zend_fopen_wrapper; } zend_stream_open_function = utility_functions->stream_open_function; zend_message_dispatcher_p = utility_functions->message_handler;#ifndef ZEND_SIGNALS zend_block_interruptions = utility_functions->block_interruptions; zend_unblock_interruptions = utility_functions->unblock_interruptions;#endif zend_get_configuration_directive_p = utility_functions->get_configuration_directive; zend_ticks_function = utility_functions->ticks_function; zend_on_timeout = utility_functions->on_timeout; zend_vspprintf = utility_functions->vspprintf_function; zend_vstrpprintf = utility_functions->vstrpprintf_function; zend_getenv = utility_functions->getenv_function; zend_resolve_path = utility_functions->resolve_path_function;#if HAVE_DTRACE/* build with dtrace support */ zend_compile_file = dtrace_compile_file; zend_execute_ex = dtrace_execute_ex; zend_execute_internal = dtrace_execute_internal;#else zend_compile_file = compile_file; zend_execute_ex = execute_ex; zend_execute_internal = NULL;#endif /* HAVE_SYS_SDT_H */ zend_compile_string = compile_string; zend_throw_exception_hook = NULL; /* Set up the default garbage collection implementation. */ gc_collect_cycles = zend_gc_collect_cycles; zend_init_opcodes_handlers(); /* set up version */ zend_version_info = strdup(ZEND_CORE_VERSION_INFO); zend_version_info_length = sizeof(ZEND_CORE_VERSION_INFO) - 1; GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable)); GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable)); GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable)); GLOBAL_CONSTANTS_TABLE = (HashTable *) malloc(sizeof(HashTable)); zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 1024, NULL, ZEND_FUNCTION_DTOR, 1, 0); zend_hash_init_ex(GLOBAL_CLASS_TABLE, 64, NULL, ZEND_CLASS_DTOR, 1, 0); zend_hash_init_ex(GLOBAL_AUTO_GLOBALS_TABLE, 8, NULL, auto_global_dtor, 1, 0); zend_hash_init_ex(GLOBAL_CONSTANTS_TABLE, 128, NULL, ZEND_CONSTANT_DTOR, 1, 0); zend_hash_init_ex(&module_registry, 32, NULL, module_destructor_zval, 1, 0); zend_init_rsrc_list_dtors();#ifdef ZTS ts_allocate_id(&compiler_globals_id, sizeof(zend_compiler_globals), (ts_allocate_ctor) compiler_globals_ctor, (ts_allocate_dtor) compiler_globals_dtor); ts_allocate_id(&executor_globals_id, sizeof(zend_executor_globals), (ts_allocate_ctor) executor_globals_ctor, (ts_allocate_dtor) executor_globals_dtor); ts_allocate_id(&language_scanner_globals_id, sizeof(zend_php_scanner_globals), (ts_allocate_ctor) php_scanner_globals_ctor, NULL); ts_allocate_id(&ini_scanner_globals_id, sizeof(zend_ini_scanner_globals), (ts_allocate_ctor) ini_scanner_globals_ctor, NULL); compiler_globals = ts_resource(compiler_globals_id); executor_globals = ts_resource(executor_globals_id); compiler_globals_dtor(compiler_globals); compiler_globals->in_compilation = 0; compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable)); compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable)); *compiler_globals->function_table = *GLOBAL_FUNCTION_TABLE; *compiler_globals->class_table = *GLOBAL_CLASS_TABLE; compiler_globals->auto_globals = GLOBAL_AUTO_GLOBALS_TABLE; zend_hash_destroy(executor_globals->zend_constants);//.........这里部分代码省略.........
开发者ID:MarkBaker,项目名称:php-src,代码行数:101,
示例18: SAPI_POST_HANDLER_FUNC//.........这里部分代码省略......... } /* Add $foo[tmp_name] */ if (is_arr_upload) { snprintf(lbuf, llen, "%s[tmp_name][%s]", abuf, array_index); } else { snprintf(lbuf, llen, "%s[tmp_name]", param); } add_protected_variable(lbuf); if (temp_filename) { ZVAL_STR_COPY(&zfilename, temp_filename); } else { ZVAL_EMPTY_STRING(&zfilename); } register_http_post_files_variable_ex(lbuf, &zfilename, &PG(http_globals)[TRACK_VARS_FILES], 1); } { zval file_size, error_type; int size_overflow = 0; char file_size_buf[65]; ZVAL_LONG(&error_type, cancel_upload); /* Add $foo[error] */ if (cancel_upload) { ZVAL_LONG(&file_size, 0); } else { if (total_bytes > ZEND_LONG_MAX) {#ifdef PHP_WIN32 if (_i64toa_s(total_bytes, file_size_buf, 65, 10)) { file_size_buf[0] = '0'; file_size_buf[1] = '/0'; }#else { int __len = snprintf(file_size_buf, 65, "%lld", total_bytes); file_size_buf[__len] = '/0'; }#endif size_overflow = 1; } else { ZVAL_LONG(&file_size, total_bytes); } } if (is_arr_upload) { snprintf(lbuf, llen, "%s[error][%s]", abuf, array_index); } else { snprintf(lbuf, llen, "%s[error]", param); } register_http_post_files_variable_ex(lbuf, &error_type, &PG(http_globals)[TRACK_VARS_FILES], 0); /* Add $foo_size */ if (is_arr_upload) { snprintf(lbuf, llen, "%s_size[%s]", abuf, array_index); } else { snprintf(lbuf, llen, "%s_size", param); } if (!is_anonymous) { if (size_overflow) { ZVAL_STRING(&file_size, file_size_buf); } safe_php_register_variable_ex(lbuf, &file_size, NULL, size_overflow); } /* Add $foo[size] */ if (is_arr_upload) { snprintf(lbuf, llen, "%s[size][%s]", abuf, array_index); } else { snprintf(lbuf, llen, "%s[size]", param); } if (size_overflow) { ZVAL_STRING(&file_size, file_size_buf); } register_http_post_files_variable_ex(lbuf, &file_size, &PG(http_globals)[TRACK_VARS_FILES], size_overflow); } efree(param); } }fileupload_done: if (php_rfc1867_callback != NULL) { multipart_event_end event_end; event_end.post_bytes_processed = SG(read_post_bytes); php_rfc1867_callback(MULTIPART_EVENT_END, &event_end, &event_extra_data); } if (lbuf) efree(lbuf); if (abuf) efree(abuf); if (array_index) efree(array_index); zend_hash_destroy(&PG(rfc1867_protected_variables)); zend_llist_destroy(&header); if (mbuff->boundary_next) efree(mbuff->boundary_next); if (mbuff->boundary) efree(mbuff->boundary); if (mbuff->buffer) efree(mbuff->buffer); if (mbuff) efree(mbuff);}
开发者ID:sektioneins,项目名称:suhosin7,代码行数:101,
示例19: php_error//.........这里部分代码省略......... for (i=0; i<=strlen(sentence); i++) { isPinyin = 0; #if PHP_MAJOR_VERSION < 7 if (zend_hash_index_find(Z_ARRVAL_P(pinyinPieces), i, (void**)&entry) == FAILURE || py_strlen(Z_STRVAL_PP(entry)) <= 0) continue; splitItem = strtok(Z_STRVAL_PP(entry), "/t"); if (zend_hash_index_find(Z_ARRVAL_P(splitIsPinyin), i, (void**)&splitIsPinyinEntry) == SUCCESS) { if (Z_BVAL_PP(splitIsPinyinEntry)) { isPinyin = 1; } } #else entry = zend_hash_index_find(Z_ARRVAL_P(pinyinPieces), i); if (NULL == entry) continue; splitItem = strtok(Z_STRVAL_P(entry), "/t"); splitIsPinyinEntry = zend_hash_index_find(Z_ARRVAL_P(splitIsPinyin), i); if (NULL != splitIsPinyinEntry) { if(Z_TYPE_INFO_P(splitIsPinyinEntry) == IS_TRUE) { isPinyin = 1; } } #endif /* 不需要拼音声调 */ CREATE_ROW_DATA_ITEM(rowDataListTmpPtr); rowDataListTmpPtr->ori = py_strdup(splitItem, 0); rowDataListPtr->next = rowDataListTmpPtr; rowDataListPtr = rowDataListTmpPtr; if (flag & (PINYIN_NONE|PINYIN_ASCII|PINYIN_LCFIRST|PINYIN_UCFIRST)) { isChangeTone = 0; for(m=0 ; m<PY_TONE_INFO_NUM; m++) { if (NULL != (wordPtr=py_strstr(splitItem, toneInfos[m].complete))){ CHANGE_STR(tmpStr, splitItem, wordPtr, toneInfos[m].complete, toneInfos[m].simple, j, k); rowDataListTmpPtr->none = py_strdup(tmpStr, 0); rowDataListTmpPtr->tone = toneInfos[m].tone; isChangeTone = 1; break; } } if (!isChangeTone && isPinyin) { rowDataListTmpPtr->none = py_strdup(rowDataListTmpPtr->ori, 0); } } if (flag & (PINYIN_LCFIRST|PINYIN_UCFIRST)){ if (NULL != rowDataListTmpPtr->none) { rowDataListTmpPtr->lcfirst = *rowDataListTmpPtr->none; rowDataListTmpPtr->ucfirst = rowDataListTmpPtr->lcfirst - 32; if (!(rowDataListTmpPtr->lcfirst >= 65 && rowDataListTmpPtr->lcfirst <= 90) && !(rowDataListTmpPtr->lcfirst >= 97 && rowDataListTmpPtr->lcfirst <= 122)){ rowDataListTmpPtr->lcfirst = 0; rowDataListTmpPtr->ucfirst = 0; } } } while((splitItem = strtok(NULL, "/t"))) { CREATE_ROW_DATA_ITEM(rowDataListTmpPtr); rowDataListTmpPtr->ori = py_strdup(splitItem, 0); rowDataListPtr->next = rowDataListTmpPtr; rowDataListPtr = rowDataListTmpPtr; if (flag & (PINYIN_NONE|PINYIN_ASCII|PINYIN_LCFIRST|PINYIN_UCFIRST)) { isChangeTone = 0; for(m=0 ; m<PY_TONE_INFO_NUM; m++) { if (NULL != (wordPtr=py_strstr(splitItem, toneInfos[m].complete))){ CHANGE_STR(tmpStr, splitItem, wordPtr, toneInfos[m].complete, toneInfos[m].simple, j, k); rowDataListTmpPtr->none = py_strdup(tmpStr, 0); rowDataListTmpPtr->tone = toneInfos[m].tone; isChangeTone = 1; break; } } if (!isChangeTone && isPinyin) { rowDataListTmpPtr->none = py_strdup(rowDataListTmpPtr->ori, 0); } } if (flag & (PINYIN_LCFIRST|PINYIN_UCFIRST)){ if (NULL != rowDataListTmpPtr->none) { rowDataListTmpPtr->lcfirst = *rowDataListTmpPtr->none; rowDataListTmpPtr->ucfirst = rowDataListTmpPtr->lcfirst - 32; if (!(rowDataListTmpPtr->lcfirst >= 65 && rowDataListTmpPtr->lcfirst <= 90) && !(rowDataListTmpPtr->lcfirst >= 97 && rowDataListTmpPtr->lcfirst <= 122)){ rowDataListTmpPtr->lcfirst = 0; rowDataListTmpPtr->ucfirst = 0; } } } } } efree(chinese); zend_hash_destroy(Z_ARRVAL_P(pinyinPieces)); efree(Z_ARRVAL_P(pinyinPieces)); efree(pinyinPieces); zend_hash_destroy(Z_ARRVAL_P(splitIsPinyin)); efree(Z_ARRVAL_P(splitIsPinyin)); efree(splitIsPinyin); return rowDataList;}
开发者ID:aizuyan,项目名称:pinyin,代码行数:101,
示例20: fcnotify_initialize//.........这里部分代码省略......... pnotify->islocal = islocal; pnotify->fcaplist = paplist; pnotify->fcalloc = palloc; pnotify->processid = WCG(fmapgdata)->pid; pnotify->fcmemaddr = palloc->memaddr; pnotify->lscavenge = GetTickCount(); /* Get memory for fcnotify header */ msize = sizeof(fcnotify_header) + (filecount - 1) * sizeof(size_t); pnotify->fcheader = (fcnotify_header *)alloc_get_cacheheader(pnotify->fcalloc, msize, CACHE_TYPE_FCNOTIFY); if(pnotify->fcheader == NULL) { result = FATAL_FCNOTIFY_INITIALIZE; goto Finished; } header = pnotify->fcheader; /* Create reader writer lock for the file change notification hashtable */ result = lock_create(&pnotify->fclock); if(FAILED(result)) { goto Finished; } result = lock_initialize(pnotify->fclock, "FILE_CHANGE_NOTIFY", 1, locktype, LOCK_USET_SREAD_XWRITE, &header->rdcount TSRMLS_CC); if(FAILED(result)) { goto Finished; } /* Create IO completion port */ pnotify->port_handle = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, (ULONG_PTR)0, 0); if(pnotify->port_handle == NULL) { result = FATAL_FCNOTIFY_INITIALIZE; goto Finished; } /* Create listener thread */ pnotify->listen_thread = CreateThread(NULL, 0, change_notification_thread, (void *)pnotify, 0, NULL); if(pnotify->listen_thread == NULL) { result = FATAL_FCNOTIFY_INITIALIZE; goto Finished; } /* Create pidhandles hashtable */ pnotify->pidhandles = (HashTable *)alloc_pemalloc(sizeof(HashTable)); if(pnotify->pidhandles == NULL) { result = FATAL_OUT_OF_LMEMORY; goto Finished; } zend_hash_init(pnotify->pidhandles, 0, NULL, NULL, 1);Finished: if(FAILED(result)) { dprintimportant("failure %d in fcnotify_initialize", result); _ASSERT(result > WARNING_COMMON_BASE); if(pnotify->listen_thread != NULL) { CloseHandle(pnotify->listen_thread); pnotify->listen_thread = NULL; } if(pnotify->port_handle != NULL) { CloseHandle(pnotify->port_handle); pnotify->port_handle = NULL; } if(pnotify->fclock != NULL) { lock_terminate(pnotify->fclock); lock_destroy(pnotify->fclock); pnotify->fclock = NULL; } if(pnotify->pidhandles != NULL) { zend_hash_destroy(pnotify->pidhandles); alloc_pefree(pnotify->pidhandles); pnotify->pidhandles = NULL; } pnotify->fcaplist = NULL; pnotify->fcheader = NULL; pnotify->fcalloc = NULL; } return result;}
开发者ID:juokaz,项目名称:wincache,代码行数:101,
示例21: user_config_cache_entry_dtorstatic void user_config_cache_entry_dtor(zval *el){ user_config_cache_entry *entry = (user_config_cache_entry *)Z_PTR_P(el); zend_hash_destroy(&entry->user_config); free(entry);}
开发者ID:andydeng,项目名称:php-src,代码行数:6,
示例22: zend_optimizer_compact_literals//.........这里部分代码省略......... opline->extended_value = class_slot[opline->op2.constant] | (opline->extended_value & ZEND_ISEMPTY); } else { opline->extended_value = cache_size | (opline->extended_value & ZEND_ISEMPTY); cache_size += sizeof(void *); class_slot[opline->op2.constant] = opline->extended_value & ~ZEND_ISEMPTY; } } break; case ZEND_FETCH_CLASS: case ZEND_INSTANCEOF: if (opline->op2_type == IS_CONST) { // op2 class if (class_slot[opline->op2.constant] >= 0) { opline->extended_value = class_slot[opline->op2.constant]; } else { opline->extended_value = cache_size; cache_size += sizeof(void *); class_slot[opline->op2.constant] = opline->extended_value; } } break; case ZEND_NEW: if (opline->op1_type == IS_CONST) { // op1 class if (class_slot[opline->op1.constant] >= 0) { opline->op2.num = class_slot[opline->op1.constant]; } else { opline->op2.num = cache_size; cache_size += sizeof(void *); class_slot[opline->op1.constant] = opline->op2.num; } } break; case ZEND_CATCH: if (opline->op1_type == IS_CONST) { // op1 class if (class_slot[opline->op1.constant] >= 0) { opline->extended_value = class_slot[opline->op1.constant] | (opline->extended_value & ZEND_LAST_CATCH); } else { opline->extended_value = cache_size | (opline->extended_value & ZEND_LAST_CATCH); cache_size += sizeof(void *); class_slot[opline->op1.constant] = opline->extended_value & ~ZEND_LAST_CATCH; } } break; case ZEND_BIND_GLOBAL: // op2 bind var if (bind_var_slot[opline->op2.constant] >= 0) { opline->extended_value = bind_var_slot[opline->op2.constant]; } else { opline->extended_value = cache_size; cache_size += sizeof(void *); bind_var_slot[opline->op2.constant] = opline->extended_value; } break; } opline++; } op_array->cache_size = cache_size; zend_hash_destroy(&hash); zend_arena_release(&ctx->arena, checkpoint); if (1) { opline = op_array->opcodes; while (1) { if (opline->opcode == ZEND_RECV_INIT) { zval *val = &op_array->literals[opline->op2.constant]; if (Z_TYPE_P(val) == IS_CONSTANT_AST) { uint32_t slot = ZEND_MM_ALIGNED_SIZE_EX(op_array->cache_size, 8); Z_CACHE_SLOT_P(val) = slot; op_array->cache_size += sizeof(zval); } } else if (opline->opcode != ZEND_RECV) { break; } opline++; } }#if DEBUG_COMPACT_LITERALS { int i, use_copy; fprintf(stderr, "Optimized literlas table size %d/n", op_array->last_literal); for (i = 0; i < op_array->last_literal; i++) { zval zv; ZVAL_COPY_VALUE(&zv, op_array->literals + i); use_copy = zend_make_printable_zval(op_array->literals + i, &zv); fprintf(stderr, "Literal %d, val (%d):%s/n", i, Z_STRLEN(zv), Z_STRVAL(zv)); if (use_copy) { zval_ptr_dtor_nogc(&zv); } } fflush(stderr); }#endif }}
开发者ID:crrodriguez,项目名称:php-src,代码行数:101,
示例23: php_xsl_apply_stylesheet//.........这里部分代码省略......... if (intern->parameter) { params = php_xsl_xslt_make_params(intern->parameter, 0); } intern->doc = emalloc(sizeof(php_libxml_node_object)); memset(intern->doc, 0, sizeof(php_libxml_node_object)); if (intern->hasKeys == 1) { doc = xmlCopyDoc(doc, 1); } else { object = Z_LIBXML_NODE_P(docp); intern->doc->document = object->document; } php_libxml_increment_doc_ref(intern->doc, doc); ctxt = xsltNewTransformContext(style, doc); ctxt->_private = (void *) intern; std_hnd = zend_get_std_object_handlers(); ZVAL_STRING(&member, "doXInclude"); doXInclude = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv); if (Z_TYPE_P(doXInclude) != IS_NULL) { convert_to_long(doXInclude); ctxt->xinclude = Z_LVAL_P(doXInclude); } zval_ptr_dtor(&member); secPrefsValue = intern->securityPrefs; /* if securityPrefs is set to NONE, we don't have to do any checks, but otherwise... */ if (secPrefsValue != XSL_SECPREF_NONE) { secPrefs = xsltNewSecurityPrefs(); if (secPrefsValue & XSL_SECPREF_READ_FILE ) { if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_READ_FILE, xsltSecurityForbid)) { secPrefsError = 1; } } if (secPrefsValue & XSL_SECPREF_WRITE_FILE ) { if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_WRITE_FILE, xsltSecurityForbid)) { secPrefsError = 1; } } if (secPrefsValue & XSL_SECPREF_CREATE_DIRECTORY ) { if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_CREATE_DIRECTORY, xsltSecurityForbid)) { secPrefsError = 1; } } if (secPrefsValue & XSL_SECPREF_READ_NETWORK) { if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_READ_NETWORK, xsltSecurityForbid)) { secPrefsError = 1; } } if (secPrefsValue & XSL_SECPREF_WRITE_NETWORK) { if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_WRITE_NETWORK, xsltSecurityForbid)) { secPrefsError = 1; } } if (0 != xsltSetCtxtSecurityPrefs(secPrefs, ctxt)) { secPrefsError = 1; } } if (secPrefsError == 1) { php_error_docref(NULL, E_WARNING, "Can't set libxslt security properties, not doing transformation for security reasons"); } else { newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params, NULL, f, ctxt); } if (f) { fclose(f); } xsltFreeTransformContext(ctxt); if (secPrefs) { xsltFreeSecurityPrefs(secPrefs); } if (intern->node_list != NULL) { zend_hash_destroy(intern->node_list); FREE_HASHTABLE(intern->node_list); intern->node_list = NULL; } php_libxml_decrement_doc_ref(intern->doc); efree(intern->doc); intern->doc = NULL; if (params) { clone = 0; while(params[clone]) { efree(params[clone++]); } efree(params); } return newdocp;}
开发者ID:guggemand,项目名称:php-src,代码行数:101,
示例24: zend_accel_script_optimizeint zend_accel_script_optimize(zend_persistent_script *script){ uint idx, j; Bucket *p, *q; zend_class_entry *ce; zend_op_array *op_array; zend_optimizer_ctx ctx; ctx.arena = zend_arena_create(64 * 1024); ctx.script = script; ctx.constants = NULL; zend_accel_optimize(&script->main_op_array, &ctx); for (idx = 0; idx < script->function_table.nNumUsed; idx++) { p = script->function_table.arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; op_array = (zend_op_array*)Z_PTR(p->val); zend_accel_optimize(op_array, &ctx); } for (idx = 0; idx < script->class_table.nNumUsed; idx++) { p = script->class_table.arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; ce = (zend_class_entry*)Z_PTR(p->val); for (j = 0; j < ce->function_table.nNumUsed; j++) { q = ce->function_table.arData + j; if (Z_TYPE(q->val) == IS_UNDEF) continue; op_array = (zend_op_array*)Z_PTR(q->val); if (op_array->scope == ce) { zend_accel_optimize(op_array, &ctx); } else if (op_array->type == ZEND_USER_FUNCTION) { zend_op_array *orig_op_array; if ((orig_op_array = zend_hash_find_ptr(&op_array->scope->function_table, q->key)) != NULL) { HashTable *ht = op_array->static_variables; *op_array = *orig_op_array; op_array->static_variables = ht; } } } } if (ZEND_OPTIMIZER_PASS_12 & OPTIMIZATION_LEVEL) { zend_accel_adjust_fcall_stack_size(&script->main_op_array, &ctx); for (idx = 0; idx < script->function_table.nNumUsed; idx++) { p = script->function_table.arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; op_array = (zend_op_array*)Z_PTR(p->val); zend_accel_adjust_fcall_stack_size(op_array, &ctx); } for (idx = 0; idx < script->class_table.nNumUsed; idx++) { p = script->class_table.arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; ce = (zend_class_entry*)Z_PTR(p->val); for (j = 0; j < ce->function_table.nNumUsed; j++) { q = ce->function_table.arData + j; if (Z_TYPE(q->val) == IS_UNDEF) continue; op_array = (zend_op_array*)Z_PTR(q->val); if (op_array->scope == ce) { zend_accel_adjust_fcall_stack_size(op_array, &ctx); } else if (op_array->type == ZEND_USER_FUNCTION) { zend_op_array *orig_op_array; if ((orig_op_array = zend_hash_find_ptr(&op_array->scope->function_table, q->key)) != NULL) { HashTable *ht = op_array->static_variables; *op_array = *orig_op_array; op_array->static_variables = ht; } } } } } if (ctx.constants) { zend_hash_destroy(ctx.constants); } zend_arena_destroy(ctx.arena); return 1;}
开发者ID:Razzwan,项目名称:php-src,代码行数:81,
示例25: sapi_globals_dtorstatic void sapi_globals_dtor(sapi_globals_struct *sapi_globals){ zend_hash_destroy(&sapi_globals->known_post_content_types);}
开发者ID:LTD-Beget,项目名称:php-src,代码行数:4,
示例26: php_shutdown_info_logosint php_shutdown_info_logos(void){ zend_hash_destroy(&phpinfo_logo_hash); return SUCCESS;}
开发者ID:0,项目名称:php-src,代码行数:5,
示例27: PHP_METHOD/** * Applies a format to a message before sending it to the log * * @param string $message * @param int $type * @param int $timestamp * @param array $context * * @return string */PHP_METHOD(Phalcon_Logger_Formatter_Firephp, format) { HashTable *_7$$4; HashPosition _6$$4; zval *_18; zend_bool _11, _14; zend_long type, timestamp, ZEPHIR_LAST_CALL_STATUS; zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *meta = NULL, *body = NULL, *backtrace = NULL, *encoded = NULL, *len = NULL, *lastTrace = NULL, *_1 = NULL, *_2, *_3, *_9, *_10, *_12, *_13, *_15, *_0$$3 = NULL, *param$$4 = NULL, *backtraceItem$$4 = NULL, *key$$4 = NULL, **_8$$4, *_4$$5, *_5$$6, *_16$$11, *_17$$11; zval *message = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &message_param, &type_param, ×tamp_param, &context); zephir_get_strval(message, message_param); type = zephir_get_intval(type_param); timestamp = zephir_get_intval(timestamp_param); if (!context) { context = ZEPHIR_GLOBAL(global_null); } if (Z_TYPE_P(context) == IS_ARRAY) { ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "interpolate", NULL, 0, message, context); zephir_check_call_status(); zephir_get_strval(message, _0$$3); } ZEPHIR_INIT_VAR(meta); zephir_create_array(meta, 1, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_2); ZVAL_LONG(_2, type); ZEPHIR_CALL_METHOD(&_1, this_ptr, "gettypestring", NULL, 0, _2); zephir_check_call_status(); zephir_array_update_string(&meta, SL("Type"), &_1, PH_COPY | PH_SEPARATE); _3 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); if (zephir_is_true(_3)) { ZEPHIR_INIT_VAR(param$$4); ZVAL_LONG(param$$4, 2); ZEPHIR_CALL_FUNCTION(&backtrace, "debug_backtrace", NULL, 165, param$$4); zephir_check_call_status(); ZEPHIR_MAKE_REF(backtrace); ZEPHIR_CALL_FUNCTION(&lastTrace, "end", NULL, 183, backtrace); ZEPHIR_UNREF(backtrace); zephir_check_call_status(); if (zephir_array_isset_string(lastTrace, SS("file"))) { zephir_array_fetch_string(&_4$$5, lastTrace, SL("file"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 130 TSRMLS_CC); zephir_array_update_string(&meta, SL("File"), &_4$$5, PH_COPY | PH_SEPARATE); } if (zephir_array_isset_string(lastTrace, SS("line"))) { zephir_array_fetch_string(&_5$$6, lastTrace, SL("line"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 134 TSRMLS_CC); zephir_array_update_string(&meta, SL("Line"), &_5$$6, PH_COPY | PH_SEPARATE); } zephir_is_iterable(backtrace, &_7$$4, &_6$$4, 1, 0, "phalcon/logger/formatter/firephp.zep", 143); for ( ; zend_hash_get_current_data_ex(_7$$4, (void**) &_8$$4, &_6$$4) == SUCCESS ; zend_hash_move_forward_ex(_7$$4, &_6$$4) ) { ZEPHIR_GET_HMKEY(key$$4, _7$$4, _6$$4); ZEPHIR_GET_HVALUE(backtraceItem$$4, _8$$4); zephir_array_unset_string(&backtraceItem$$4, SS("object"), PH_SEPARATE); zephir_array_unset_string(&backtraceItem$$4, SS("args"), PH_SEPARATE); zephir_array_update_zval(&backtrace, key$$4, &backtraceItem$$4, PH_COPY | PH_SEPARATE); } zend_hash_destroy(_7$$4); FREE_HASHTABLE(_7$$4); } _9 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC); if (zephir_is_true(_9)) { zephir_array_update_string(&meta, SL("Label"), &message, PH_COPY | PH_SEPARATE); } _10 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC); _11 = !zephir_is_true(_10); if (_11) { _12 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); _11 = !zephir_is_true(_12); } _13 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC); _14 = zephir_is_true(_13); if (_14) { _15 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); _14 = !zephir_is_true(_15); } if (_11) { ZEPHIR_CPY_WRT(body, message); } else if (_14) { ZEPHIR_INIT_NVAR(body); ZVAL_STRING(body, "", 1); } else { ZEPHIR_INIT_NVAR(body); array_init(body); _16$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);//.........这里部分代码省略.........
开发者ID:zamronypj,项目名称:cphalcon,代码行数:101,
注:本文中的zend_hash_destroy函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zend_hash_exists函数代码示例 C++ zend_hash_add函数代码示例 |