Index: ext/sqlite/sqlite.c =================================================================== RCS file: /repository/php-src/ext/sqlite/sqlite.c,v retrieving revision 1.166.2.13.2.9.2.10 diff -u -p -r1.166.2.13.2.9.2.10 sqlite.c --- ext/sqlite/sqlite.c 2 Aug 2008 04:46:06 -0000 1.166.2.13.2.9.2.10 +++ ext/sqlite/sqlite.c 8 Aug 2008 19:56:15 -0000 @@ -1687,10 +1687,9 @@ PHP_FUNCTION(sqlite_open) zval *errmsg = NULL; zval *object = getThis(); - php_set_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception TSRMLS_CC); + zend_replace_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception, NULL TSRMLS_CC); if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/", &filename, &filename_len, &mode, &errmsg)) { - php_std_error_handling(); return; } if (errmsg) { @@ -1701,7 +1700,6 @@ PHP_FUNCTION(sqlite_open) if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) { /* resolve the fully-qualified path name to use as the hash key */ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { - php_std_error_handling(); if (object) { RETURN_NULL(); } else { @@ -1711,7 +1709,6 @@ PHP_FUNCTION(sqlite_open) if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(fullpath TSRMLS_CC)) { - php_std_error_handling(); efree(fullpath); if (object) { RETURN_NULL(); @@ -1726,7 +1723,6 @@ PHP_FUNCTION(sqlite_open) if (fullpath) { efree(fullpath); } - php_std_error_handling(); } /* }}} */ @@ -1739,10 +1735,9 @@ PHP_FUNCTION(sqlite_factory) int filename_len; zval *errmsg = NULL; - php_set_error_handling(EH_THROW, sqlite_ce_exception TSRMLS_CC); + zend_replace_error_handling(EH_THROW, sqlite_ce_exception, NULL TSRMLS_CC); if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/", &filename, &filename_len, &mode, &errmsg)) { - php_std_error_handling(); RETURN_NULL(); } if (errmsg) { @@ -1753,14 +1748,12 @@ PHP_FUNCTION(sqlite_factory) if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) { /* resolve the fully-qualified path name to use as the hash key */ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { - php_std_error_handling(); RETURN_NULL(); } if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(fullpath TSRMLS_CC)) { efree(fullpath); - php_std_error_handling(); RETURN_NULL(); } } @@ -1769,7 +1762,6 @@ PHP_FUNCTION(sqlite_factory) if (fullpath) { efree(fullpath); } - php_std_error_handling(); } /* }}} */ @@ -2425,11 +2417,11 @@ PHP_FUNCTION(sqlite_fetch_object) zend_fcall_info_cache fcc; zval *retval_ptr; zval *ctor_params = NULL; + zend_error_handling error_handling; - php_set_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception TSRMLS_CC); + zend_replace_error_handling(object ? EH_THROW : EH_NORMAL, sqlite_ce_exception, &error_handling TSRMLS_CC); if (object) { if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|szb", &class_name, &class_name_len, &ctor_params, &decode_binary)) { - php_std_error_handling(); return; } RES_FROM_OBJECT(res, object); @@ -2440,7 +2432,6 @@ PHP_FUNCTION(sqlite_fetch_object) } } else { if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|szb", &zres, &class_name, &class_name_len, &ctor_params, &decode_binary)) { - php_std_error_handling(); return; } ZEND_FETCH_RESOURCE(res, struct php_sqlite_result *, &zres, -1, "sqlite result", le_sqlite_result); @@ -2453,21 +2444,19 @@ PHP_FUNCTION(sqlite_fetch_object) if (!ce) { zend_throw_exception_ex(sqlite_ce_exception, 0 TSRMLS_CC, "Could not find class '%s'", class_name); - php_std_error_handling(); return; } if (res->curr_row < res->nrows) { php_sqlite_fetch_array(res, PHPSQLITE_ASSOC, decode_binary, 1, &dataset TSRMLS_CC); } else { - php_std_error_handling(); RETURN_FALSE; } object_and_properties_init(return_value, ce, NULL); zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC); - php_std_error_handling(); /* before calling the ctor */ + zend_restore_error_handling(&error_handling TSRMLS_CC); if (ce->constructor) { fci.size = sizeof(fci); Index: ext/spl/spl_array.c =================================================================== RCS file: /repository/php-src/ext/spl/spl_array.c,v retrieving revision 1.71.2.17.2.13.2.20 diff -u -p -r1.71.2.17.2.13.2.20 spl_array.c --- ext/spl/spl_array.c 4 Aug 2008 11:45:21 -0000 1.71.2.17.2.13.2.20 +++ ext/spl/spl_array.c 8 Aug 2008 19:56:16 -0000 @@ -909,7 +909,6 @@ static void spl_array_set_array(zval *ob intern->array = *array; } else { if (Z_TYPE_PP(array) != IS_OBJECT && Z_TYPE_PP(array) != IS_ARRAY) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC); return; } @@ -928,7 +927,6 @@ static void spl_array_set_array(zval *ob zend_object_get_properties_t handler = Z_OBJ_HANDLER_PP(array, get_properties); if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties) || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_PP(array)->name, intern->std.ce->name); } } @@ -985,19 +983,18 @@ SPL_METHOD(Array, __construct) if (ZEND_NUM_ARGS() == 0) { return; /* nothing to do */ } - php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC); + + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|ls", &array, &ar_flags, &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } if (ZEND_NUM_ARGS() > 2) { if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } intern->ce_get_iterator = *pce_get_iterator; @@ -1007,7 +1004,6 @@ SPL_METHOD(Array, __construct) spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -1022,13 +1018,11 @@ SPL_METHOD(Array, setIteratorClass) zend_class_entry ** pce_get_iterator; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } if (zend_lookup_class(class_name, class_name_len, &pce_get_iterator TSRMLS_CC) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "A class that implements Iterator must be specified", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } intern->ce_get_iterator = *pce_get_iterator; Index: ext/spl/spl_iterators.c =================================================================== RCS file: /repository/php-src/ext/spl/spl_iterators.c,v retrieving revision 1.73.2.30.2.28.2.12 diff -u -p -r1.73.2.30.2.28.2.12 spl_iterators.c --- ext/spl/spl_iterators.c 2 Aug 2008 04:46:06 -0000 1.73.2.30.2.28.2.12 +++ ext/spl/spl_iterators.c 8 Aug 2008 19:56:16 -0000 @@ -425,7 +425,7 @@ static void spl_recursive_it_it_construc long mode, flags; int inc_refcount = 1; - php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); switch(rit_type) { case RIT_RecursiveTreeIterator: { @@ -480,7 +480,6 @@ static void spl_recursive_it_it_construc if (iterator && !inc_refcount) { zval_ptr_dtor(&iterator); } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC); return; } @@ -531,7 +530,6 @@ static void spl_recursive_it_it_construc intern->iterators[0].ce = ce_iterator; intern->iterators[0].state = RS_START; - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* {{{ proto void RecursiveIteratorIterator::__construct(RecursiveIterator|IteratorAggregate it [, int mode = RIT_LEAVES_ONLY [, int flags = 0]]) throws InvalidArgumentException @@ -918,11 +916,12 @@ static void spl_recursive_tree_iterator_ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object * object, zval * return_value TSRMLS_DC) { zend_object_iterator *iterator = object->iterators[object->level].iterator; - zval **data; + zval **data; + zend_error_handling error_handling; iterator->funcs->get_current_data(iterator, &data TSRMLS_CC); - php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC); RETVAL_ZVAL(*data, 1, 0); if (Z_TYPE_P(return_value) == IS_ARRAY) { zval_dtor(return_value); @@ -930,7 +929,7 @@ static void spl_recursive_tree_iterator_ } else { convert_to_string(return_value); } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); } static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object * object, zval * return_value TSRMLS_DC) @@ -1251,7 +1250,7 @@ static spl_dual_it_object* spl_dual_it_c return NULL; } - php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); intern->dit_type = dit_type; switch (dit_type) { @@ -1259,16 +1258,13 @@ static spl_dual_it_object* spl_dual_it_c intern->u.limit.offset = 0; /* start at beginning */ intern->u.limit.count = -1; /* get all */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } if (intern->u.limit.offset < 0) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be > 0", 0 TSRMLS_CC); return NULL; } if (intern->u.limit.count < 0 && intern->u.limit.count != -1) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC); return NULL; } @@ -1278,11 +1274,9 @@ static spl_dual_it_object* spl_dual_it_c case DIT_RecursiveCachingIterator: { long flags = CIT_CALL_TOSTRING; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &zobject, ce_inner, &flags) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } if (spl_cit_check_flags(flags) != SUCCESS) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_CURRENT", 0 TSRMLS_CC); return NULL; } @@ -1297,7 +1291,6 @@ static spl_dual_it_object* spl_dual_it_c int class_name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|s", &zobject, ce_inner, &class_name, &class_name_len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } ce = Z_OBJCE_P(zobject); @@ -1308,7 +1301,6 @@ static spl_dual_it_object* spl_dual_it_c || !(*pce_cast)->get_iterator ) { zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } ce = *pce_cast; @@ -1319,12 +1311,10 @@ static spl_dual_it_object* spl_dual_it_c if (retval) { zval_ptr_dtor(&retval); } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } if (!retval || Z_TYPE_P(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(retval), zend_ce_traversable TSRMLS_CC)) { zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "%s::getIterator() must return an object that implememnts Traversable", ce->name); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } zobject = retval; @@ -1338,7 +1328,6 @@ static spl_dual_it_object* spl_dual_it_c spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 1 TSRMLS_CC); zend_call_method_with_0_params(&intern->u.append.zarrayit, spl_ce_ArrayIterator, &spl_ce_ArrayIterator->constructor, "__construct", NULL); intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, intern->u.append.zarrayit, 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return intern; #if HAVE_PCRE || HAVE_BUNDLED_PCRE case DIT_RegexIterator: @@ -1351,12 +1340,10 @@ static spl_dual_it_object* spl_dual_it_c intern->u.regex.flags = 0; intern->u.regex.preg_flags = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|lll", &zobject, ce_inner, ®ex, ®ex_len, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } if (mode < 0 || mode >= REGIT_MODE_MAX) { zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %ld", mode); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } intern->u.regex.mode = mode; @@ -1364,7 +1351,6 @@ static spl_dual_it_object* spl_dual_it_c intern->u.regex.pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC); if (intern->u.regex.pce == NULL) { /* pcre_get_compiled_regex_cache has already sent error */ - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } intern->u.regex.pce->refcount++; @@ -1373,13 +1359,12 @@ static spl_dual_it_object* spl_dual_it_c #endif default: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobject, ce_inner) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } break; } - php_set_error_handling(EH_THROW, zend_exception_get_default(TSRMLS_C) TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); if (inc_refcount) { Z_ADDREF_P(zobject); @@ -1389,7 +1374,6 @@ static spl_dual_it_object* spl_dual_it_c intern->inner.object = zend_object_store_get_object(zobject TSRMLS_CC); intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0 TSRMLS_CC); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return intern; } Index: ext/spl/spl_observer.c =================================================================== RCS file: /repository/php-src/ext/spl/spl_observer.c,v retrieving revision 1.2.2.6.2.3.2.8 diff -u -p -r1.2.2.6.2.3.2.8 spl_observer.c --- ext/spl/spl_observer.c 22 Jul 2008 22:54:35 -0000 1.2.2.6.2.3.2.8 +++ ext/spl/spl_observer.c 8 Aug 2008 19:56:16 -0000 @@ -640,15 +640,12 @@ SPL_METHOD(MultipleIterator, __construct spl_SplObjectStorage *intern; long flags = MIT_NEED_ALL|MIT_KEYS_NUMERIC; - php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); intern->flags = flags; } Index: ext/spl/spl_directory.c =================================================================== RCS file: /repository/php-src/ext/spl/spl_directory.c,v retrieving revision 1.45.2.27.2.23.2.28 diff -u -p -r1.45.2.27.2.23.2.28 spl_directory.c --- ext/spl/spl_directory.c 25 Jul 2008 08:23:07 -0000 1.45.2.27.2.23.2.28 +++ ext/spl/spl_directory.c 8 Aug 2008 19:56:17 -0000 @@ -391,7 +391,7 @@ static spl_filesystem_object * spl_files return NULL; } - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); ce = ce ? ce : source->info_class; return_value->value.obj = spl_filesystem_object_new_ex(ce, &intern TSRMLS_CC); @@ -406,8 +406,6 @@ static spl_filesystem_object * spl_files spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy TSRMLS_CC); } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); - return intern; } /* }}} */ @@ -416,8 +414,9 @@ static spl_filesystem_object * spl_files spl_filesystem_object *intern; zend_bool use_include_path = 0; zval *arg1, *arg2; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC); switch (source->type) { case SPL_FS_INFO: @@ -426,7 +425,7 @@ static spl_filesystem_object * spl_files case SPL_FS_DIR: if (!source->u.dir.entry.d_name[0]) { zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Could not open file"); - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } } @@ -477,7 +476,7 @@ static spl_filesystem_object * spl_files if (ht && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sbr", &intern->u.file.open_mode, &intern->u.file.open_mode_len, &use_include_path, &intern->u.file.zcontext) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); intern->u.file.open_mode = NULL; zval_dtor(return_value); Z_TYPE_P(return_value) = IS_NULL; @@ -485,7 +484,7 @@ static spl_filesystem_object * spl_files } if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); zval_dtor(return_value); Z_TYPE_P(return_value) = IS_NULL; return NULL; @@ -493,11 +492,11 @@ static spl_filesystem_object * spl_files } break; case SPL_FS_DIR: - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Operation not supported"); return NULL; } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); + zend_restore_error_handling(&error_handling TSRMLS_CC); return NULL; } /* }}} */ @@ -605,7 +604,7 @@ void spl_filesystem_object_construct(INT int parsed, len; long flags; - php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); if (ctor_flags & DIT_CTOR_FLAGS) { flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO; @@ -621,11 +620,9 @@ void spl_filesystem_object_construct(INT flags |= SPL_FILE_DIR_UNIXPATHS; } if (parsed == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } if (!len) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Directory name must not be empty."); return; } @@ -642,7 +639,6 @@ void spl_filesystem_object_construct(INT intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0; - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -905,7 +901,7 @@ SPL_METHOD(DirectoryIterator, isDot) /* {{{ proto void SplFileInfo::__construct(string file_name) Cronstructs a new SplFileInfo from a path. */ -/* php_set_error_handling() is used to throw exceptions in case +/* zend_replace_error_handling() is used to throw exceptions in case the constructor fails. Here we use this to ensure the object has a valid directory resource. @@ -918,10 +914,9 @@ SPL_METHOD(SplFileInfo, __construct) char *path; int len; - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } @@ -930,8 +925,6 @@ SPL_METHOD(SplFileInfo, __construct) spl_filesystem_info_set_filename(intern, path, len, 1 TSRMLS_CC); /* intern->type = SPL_FS_INFO; already set */ - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -941,10 +934,9 @@ SPL_METHOD(SplFileInfo, func_name) \ { \ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); \ \ - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);\ + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC);\ spl_filesystem_object_get_file_name(intern TSRMLS_CC); \ php_stat(intern->file_name, intern->file_name_len, func_num, return_value TSRMLS_CC); \ - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);\ } /* }}} */ @@ -1031,7 +1023,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget) int ret; char buff[MAXPATHLEN]; - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); #ifdef HAVE_SYMLINK ret = readlink(intern->file_name, buff, MAXPATHLEN-1); @@ -1048,7 +1040,6 @@ SPL_METHOD(SplFileInfo, getLinkTarget) RETVAL_STRINGL(buff, ret, 1); } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -1061,7 +1052,7 @@ SPL_METHOD(SplFileInfo, getRealPath) char buff[MAXPATHLEN]; char *filename; - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); if (intern->type == SPL_FS_DIR && !intern->file_name && intern->u.dir.entry.d_name[0]) { spl_filesystem_object_get_file_name(intern TSRMLS_CC); @@ -1084,7 +1075,6 @@ SPL_METHOD(SplFileInfo, getRealPath) } else { RETVAL_FALSE; } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ #endif @@ -1106,13 +1096,11 @@ SPL_METHOD(SplFileInfo, setFileClass) spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = spl_ce_SplFileObject; - php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { intern->file_class = ce; } - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -1123,13 +1111,11 @@ SPL_METHOD(SplFileInfo, setInfoClass) spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = spl_ce_SplFileInfo; - php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { intern->info_class = ce; } - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -1140,13 +1126,11 @@ SPL_METHOD(SplFileInfo, getFileInfo) spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = intern->info_class; - php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { spl_filesystem_object_create_type(ht, intern, SPL_FS_INFO, ce, return_value TSRMLS_CC); } - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -1157,7 +1141,7 @@ SPL_METHOD(SplFileInfo, getPathInfo) spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_class_entry *ce = intern->info_class; - php_set_error_handling(EH_THROW, spl_ce_UnexpectedValueException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) { int path_len; @@ -1166,8 +1150,6 @@ SPL_METHOD(SplFileInfo, getPathInfo) spl_filesystem_object_create_info(intern, path, path_len, 1, ce, return_value TSRMLS_CC); } } - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -1967,7 +1949,7 @@ SPL_METHOD(SplFileObject, __construct) char *tmp_path; int tmp_path_len; - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); intern->u.file.open_mode = "r"; intern->u.file.open_mode_len = 1; @@ -1976,7 +1958,6 @@ SPL_METHOD(SplFileObject, __construct) &intern->file_name, &intern->file_name_len, &intern->u.file.open_mode, &intern->u.file.open_mode_len, &use_include_path, &intern->u.file.zcontext) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } @@ -2006,7 +1987,6 @@ SPL_METHOD(SplFileObject, __construct) intern->_path = estrndup(intern->u.file.stream->orig_path, intern->_path_len); } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ /* {{{ proto void SplTempFileObject::__construct([int max_memory]) @@ -2017,10 +1997,9 @@ SPL_METHOD(SplTempFileObject, __construc char tmp_fname[48]; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_memory) == FAILURE) { - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } @@ -2042,8 +2021,6 @@ SPL_METHOD(SplTempFileObject, __construc intern->_path_len = 0; intern->_path = estrndup("", 0); } - - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ /* {{{ proto void SplFileObject::rewind() Index: ext/mysqli/mysqli_driver.c =================================================================== RCS file: /repository/php-src/ext/mysqli/mysqli_driver.c,v retrieving revision 1.4.2.3.2.2.2.4 diff -u -p -r1.4.2.3.2.2.2.4 mysqli_driver.c --- ext/mysqli/mysqli_driver.c 18 Mar 2008 16:57:31 -0000 1.4.2.3.2.2.2.4 +++ ext/mysqli/mysqli_driver.c 8 Aug 2008 19:56:17 -0000 @@ -78,8 +78,8 @@ static int name(mysqli_object *obj, zval static int driver_report_write(mysqli_object *obj, zval *value TSRMLS_DC) { MyG(report_mode) = Z_LVAL_P(value); - php_set_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, - zend_exception_get_default(TSRMLS_C) TSRMLS_CC); + /*FIXME*/ + zend_replace_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, NULL, NULL TSRMLS_CC); return SUCCESS; } /* }}} */ Index: ext/simplexml/simplexml.c =================================================================== RCS file: /repository/php-src/ext/simplexml/simplexml.c,v retrieving revision 1.151.2.22.2.35.2.16 diff -u -p -r1.151.2.22.2.35.2.16 simplexml.c --- ext/simplexml/simplexml.c 9 Jul 2008 21:27:28 -0000 1.151.2.22.2.35.2.16 +++ ext/simplexml/simplexml.c 8 Aug 2008 19:56:18 -0000 @@ -2176,14 +2176,14 @@ SXE_METHOD(__construct) xmlDocPtr docp; long options = 0; zend_bool is_url = 0, isprefix = 0; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, zend_exception_get_default(TSRMLS_C) TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); docp = is_url ? xmlReadFile(data, NULL, options) : xmlReadMemory(data, data_len, NULL, NULL, options); Index: ext/date/php_date.c =================================================================== RCS file: /repository/php-src/ext/date/php_date.c,v retrieving revision 1.43.2.45.2.51.2.53 diff -u -p -r1.43.2.45.2.51.2.53 php_date.c --- ext/date/php_date.c 3 Aug 2008 16:45:15 -0000 1.43.2.45.2.51.2.53 +++ ext/date/php_date.c 8 Aug 2008 19:56:20 -0000 @@ -2519,11 +2519,11 @@ PHP_METHOD(DateTime, __construct) char *time_str = NULL; int time_str_len = 0; - php_set_error_handling(EH_THROW, NULL TSRMLS_CC); + + zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC); } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -3193,7 +3193,7 @@ PHP_METHOD(DateTimeZone, __construct) timelib_tzinfo *tzi = NULL; php_timezone_obj *tzobj; - php_set_error_handling(EH_THROW, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) { if (SUCCESS == timezone_initialize(&tzi, tz TSRMLS_CC)) { tzobj = zend_object_store_get_object(getThis() TSRMLS_CC); @@ -3204,7 +3204,6 @@ PHP_METHOD(DateTimeZone, __construct) ZVAL_NULL(getThis()); } } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -3537,7 +3536,7 @@ PHP_METHOD(DateInterval, __construct) php_interval_obj *diobj; timelib_rel_time *reltime; - php_set_error_handling(EH_THROW, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &interval_string, &interval_string_length) == SUCCESS) { if (date_interval_initialize(&reltime, interval_string, interval_string_length TSRMLS_CC) == SUCCESS) { diobj = zend_object_store_get_object(getThis() TSRMLS_CC); @@ -3547,7 +3546,6 @@ PHP_METHOD(DateInterval, __construct) ZVAL_NULL(getThis()); } } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ @@ -3691,7 +3689,7 @@ PHP_METHOD(DatePeriod, __construct) int isostr_len = 0; timelib_time *clone; - php_set_error_handling(EH_THROW, NULL TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, NULL TSRMLS_CC); if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOl|l", &start, date_ce_date, &interval, date_ce_interval, &recurrences, &options) == FAILURE) { if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_date, &interval, date_ce_interval, &end, date_ce_date, &options) == FAILURE) { if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &isostr, &isostr_len, &options) == FAILURE) { @@ -3762,7 +3760,6 @@ PHP_METHOD(DatePeriod, __construct) dpobj->recurrences = recurrences + dpobj->include_start_date; dpobj->initialized = 1; - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } /* }}} */ Index: ext/dom/documentfragment.c =================================================================== RCS file: /repository/php-src/ext/dom/documentfragment.c,v retrieving revision 1.15.2.1.2.1.2.3 diff -u -p -r1.15.2.1.2.1.2.3 documentfragment.c --- ext/dom/documentfragment.c 4 Feb 2008 15:22:59 -0000 1.15.2.1.2.1.2.3 +++ ext/dom/documentfragment.c 8 Aug 2008 19:56:20 -0000 @@ -59,14 +59,14 @@ PHP_METHOD(domdocumentfragment, __constr zval *id; xmlNodePtr nodep = NULL, oldnode = NULL; dom_object *intern; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); nodep = xmlNewDocFragment(NULL); if (!nodep) { Index: ext/dom/element.c =================================================================== RCS file: /repository/php-src/ext/dom/element.c,v retrieving revision 1.36.2.4.2.8.2.5 diff -u -p -r1.36.2.4.2.8.2.5 element.c --- ext/dom/element.c 14 Jun 2008 11:22:57 -0000 1.36.2.4.2.8.2.5 +++ ext/dom/element.c 8 Aug 2008 19:56:21 -0000 @@ -181,13 +181,13 @@ PHP_METHOD(domelement, __construct) int errorcode = 0, uri_len = 0; int name_len, value_len = 0, name_valid; xmlNsPtr nsptr = NULL; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { Index: ext/dom/processinginstruction.c =================================================================== RCS file: /repository/php-src/ext/dom/processinginstruction.c,v retrieving revision 1.17.2.1.2.1.2.4 diff -u -p -r1.17.2.1.2.1.2.4 processinginstruction.c --- ext/dom/processinginstruction.c 4 Feb 2008 15:22:59 -0000 1.17.2.1.2.1.2.4 +++ ext/dom/processinginstruction.c 8 Aug 2008 19:56:21 -0000 @@ -57,14 +57,14 @@ PHP_METHOD(domprocessinginstruction, __c dom_object *intern; char *name, *value = NULL; int name_len, value_len, name_valid; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { Index: ext/dom/attr.c =================================================================== RCS file: /repository/php-src/ext/dom/attr.c,v retrieving revision 1.18.2.2.2.2.2.4 diff -u -p -r1.18.2.2.2.2.2.4 attr.c --- ext/dom/attr.c 4 Feb 2008 15:22:59 -0000 1.18.2.2.2.2.2.4 +++ ext/dom/attr.c 8 Aug 2008 19:56:21 -0000 @@ -65,14 +65,14 @@ PHP_METHOD(domattr, __construct) dom_object *intern; char *name, *value = NULL; int name_len, value_len, name_valid; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC); name_valid = xmlValidateName((xmlChar *) name, 0); Index: ext/dom/document.c =================================================================== RCS file: /repository/php-src/ext/dom/document.c,v retrieving revision 1.68.2.3.2.5.2.5 diff -u -p -r1.68.2.3.2.5.2.5 document.c --- ext/dom/document.c 4 Feb 2008 15:22:59 -0000 1.68.2.3.2.5.2.5 +++ ext/dom/document.c 8 Aug 2008 19:56:21 -0000 @@ -1501,14 +1501,14 @@ PHP_METHOD(domdocument, __construct) dom_object *intern; char *encoding, *version = NULL; int encoding_len = 0, version_len = 0, refcount; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); docp = xmlNewDoc(version); if (!docp) { Index: ext/dom/entityreference.c =================================================================== RCS file: /repository/php-src/ext/dom/entityreference.c,v retrieving revision 1.12.2.1.2.2.2.3 diff -u -p -r1.12.2.1.2.2.2.3 entityreference.c --- ext/dom/entityreference.c 4 Feb 2008 15:22:59 -0000 1.12.2.1.2.2.2.3 +++ ext/dom/entityreference.c 8 Aug 2008 19:56:21 -0000 @@ -56,14 +56,14 @@ PHP_METHOD(domentityreference, __constru dom_object *intern; char *name; int name_len, name_valid; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { Index: ext/dom/comment.c =================================================================== RCS file: /repository/php-src/ext/dom/comment.c,v retrieving revision 1.11.2.1.2.1.2.3 diff -u -p -r1.11.2.1.2.1.2.3 comment.c --- ext/dom/comment.c 4 Feb 2008 15:22:59 -0000 1.11.2.1.2.1.2.3 +++ ext/dom/comment.c 8 Aug 2008 19:56:21 -0000 @@ -56,14 +56,14 @@ PHP_METHOD(domcomment, __construct) dom_object *intern; char *value = NULL; int value_len; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); nodep = xmlNewComment((xmlChar *) value); if (!nodep) { Index: ext/dom/xpath.c =================================================================== RCS file: /repository/php-src/ext/dom/xpath.c,v retrieving revision 1.26.2.1.2.1.2.4 diff -u -p -r1.26.2.1.2.1.2.4 xpath.c --- ext/dom/xpath.c 29 Jan 2008 15:55:23 -0000 1.26.2.1.2.1.2.4 +++ ext/dom/xpath.c 8 Aug 2008 19:56:21 -0000 @@ -275,14 +275,14 @@ PHP_METHOD(domxpath, __construct) dom_object *docobj; dom_xpath_object *intern; xmlXPathContextPtr ctx, oldctx; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj); ctx = xmlXPathNewContext(docp); Index: ext/dom/text.c =================================================================== RCS file: /repository/php-src/ext/dom/text.c,v retrieving revision 1.23.2.1.2.4.2.3 diff -u -p -r1.23.2.1.2.4.2.3 text.c --- ext/dom/text.c 4 Feb 2008 15:22:59 -0000 1.23.2.1.2.4.2.3 +++ ext/dom/text.c 8 Aug 2008 19:56:21 -0000 @@ -74,14 +74,14 @@ PHP_METHOD(domtext, __construct) dom_object *intern; char *value = NULL; int value_len; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); nodep = xmlNewText((xmlChar *) value); if (!nodep) { Index: ext/dom/cdatasection.c =================================================================== RCS file: /repository/php-src/ext/dom/cdatasection.c,v retrieving revision 1.11.2.1.2.1.2.3 diff -u -p -r1.11.2.1.2.1.2.3 cdatasection.c --- ext/dom/cdatasection.c 4 Feb 2008 15:22:59 -0000 1.11.2.1.2.1.2.3 +++ ext/dom/cdatasection.c 8 Aug 2008 19:56:21 -0000 @@ -56,14 +56,14 @@ PHP_METHOD(domcdatasection, __construct) dom_object *intern; char *value = NULL; int value_len; + zend_error_handling error_handling; - php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC); + zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC); if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) { - php_std_error_handling(); return; } - php_std_error_handling(); + zend_restore_error_handling(&error_handling TSRMLS_CC); nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len); if (!nodep) {