diff options
author | Marcus Boerger <helly@php.net> | 2006-05-10 00:00:13 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2006-05-10 00:00:13 +0000 |
commit | 77c1b56cd759b8fd819976a5aa7c40b5268a81f4 (patch) | |
tree | 068e4b951e7551359e9f8fc978fa24633f7097d8 | |
parent | 11f26c2c2a3f41863347fcabddd6f1097518ce99 (diff) | |
download | php-git-77c1b56cd759b8fd819976a5aa7c40b5268a81f4.tar.gz |
- Update after api changes
-rw-r--r-- | ext/date/php_date.c | 4 | ||||
-rw-r--r-- | ext/dom/dom_iterators.c | 5 | ||||
-rw-r--r-- | ext/dom/php_dom.c | 8 | ||||
-rw-r--r-- | ext/dom/php_dom.h | 2 | ||||
-rw-r--r-- | ext/mysql/php_mysql.c | 6 | ||||
-rw-r--r-- | ext/mysqli/mysqli.c | 8 | ||||
-rw-r--r-- | ext/mysqli/mysqli_driver.c | 2 | ||||
-rw-r--r-- | ext/pgsql/pgsql.c | 6 | ||||
-rw-r--r-- | ext/reflection/php_reflection.c | 2 | ||||
-rw-r--r-- | ext/simplexml/simplexml.c | 26 | ||||
-rw-r--r-- | ext/soap/soap.c | 16 | ||||
-rw-r--r-- | ext/sqlite/sqlite.c | 91 | ||||
-rw-r--r-- | ext/tidy/tidy.c | 8 | ||||
-rw-r--r-- | ext/xmlwriter/php_xmlwriter.c | 74 | ||||
-rw-r--r-- | sapi/cli/php_cli.c | 2 |
15 files changed, 123 insertions, 137 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 31076212fe..0f1f7c07c1 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -99,8 +99,8 @@ zend_function_entry date_funcs_timezone[] = { ZEND_NAMED_FE(getName, ZEND_FN(timezone_name_get), NULL) ZEND_NAMED_FE(getOffset, ZEND_FN(timezone_offset_get), NULL) ZEND_NAMED_FE(getTransistions, ZEND_FN(timezone_transistions_get), NULL) - ZEND_MALIAS(timezone, listAbbreviations, abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_MALIAS(timezone, listIdentifiers, identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME_MAPPING(listAbbreviations, timezone_abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME_MAPPING(listIdentifiers, timezone_identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) {NULL, NULL, NULL} }; diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c index f7b84fc750..9a6425ad16 100644 --- a/ext/dom/dom_iterators.c +++ b/ext/dom/dom_iterators.c @@ -253,7 +253,7 @@ zend_object_iterator_funcs php_dom_iterator_funcs = { NULL }; -zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) +zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) { dom_object *intern; dom_nnodemap_object *objmap; @@ -263,6 +263,9 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TS HashTable *nodeht; zval **entry; + if (by_ref) { + zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); + } php_dom_iterator *iterator = emalloc(sizeof(php_dom_iterator)); object->refcount++; diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 1180c73b82..07262a8d49 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -464,11 +464,7 @@ static zend_function_entry dom_functions[] = { }; static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) { - if (EG(ze1_compatibility_mode)) { - return &dom_ze1_object_handlers; - } else { - return &dom_object_handlers; - } + return &dom_object_handlers; } static zend_module_dep dom_deps[] = { @@ -517,7 +513,7 @@ PHP_MINIT_FUNCTION(dom) zend_hash_init(&classes, 0, NULL, NULL, 1); INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions); - dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC); + dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL; zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 08d015d991..d53440ba91 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -109,7 +109,7 @@ void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xml xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index); xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index); -zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC); +zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); #define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ INIT_CLASS_ENTRY(ce, name, funcs); \ diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index ce8561bed9..bef974313b 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -2043,7 +2043,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, * single value is an array. Also we'd have to make that one * argument passed by reference. */ - zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0 TSRMLS_CC); + zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); return; } } else { @@ -2058,7 +2058,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, fcc.object_pp = &return_value; if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); + zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); } else { if (retval_ptr) { zval_ptr_dtor(&retval_ptr); @@ -2068,7 +2068,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, efree(fci.params); } } else if (ctor_params) { - zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); + zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); } } #endif diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 7ba5a9d8fb..684cddf305 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -322,7 +322,7 @@ static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC) } else if (obj->zo.ce == mysqli_driver_class_entry) { f.handler = ZEND_FN(mysqli_driver_construct); } else if (obj->zo.ce == mysqli_warning_class_entry) { - f.handler = ZEND_FN(mysqli_warning___construct); + f.handler = ZEND_MN(mysqli_warning___construct); } return (union _zend_function*)&f; @@ -877,7 +877,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags * single value is an array. Also we'd have to make that one * argument passed by reference. */ - zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0 TSRMLS_CC); + zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); return; } } else { @@ -892,7 +892,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags fcc.object_pp = &return_value; if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); + zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); } else { if (retval_ptr) { zval_ptr_dtor(&retval_ptr); @@ -902,7 +902,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags efree(fci.params); } } else if (ctor_params) { - zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); + zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); } } } diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index d1c776ad19..7a16e6284e 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -79,7 +79,7 @@ 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_CC); + zend_exception_get_default(TSRMLS_C) TSRMLS_CC); return SUCCESS; } /* }}} */ diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 63a6f770af..3c3a71eb7a 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2107,7 +2107,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, * single value is an array. Also we'd have to make that one * argument passed by reference. */ - zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0 TSRMLS_CC); + zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); return; } } else { @@ -2122,7 +2122,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, fcc.object_pp = &return_value; if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { - zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); + zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); } else { if (retval_ptr) { zval_ptr_dtor(&retval_ptr); @@ -2132,7 +2132,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, efree(fci.params); } } else if (ctor_params) { - zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); + zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); } } } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 63e1f83f58..9d8260f129 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4409,7 +4409,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ reflection_object_handlers.write_property = _reflection_write_property; INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions); - reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default(), NULL TSRMLS_CC); + reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions); reflection_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC); diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index a51b4804ea..a2cb8e99ba 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1567,7 +1567,7 @@ static int cast_object(zval *object, int type, char *contents TSRMLS_DC) /* {{{ sxe_object_cast() */ -static int sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) +static int sxe_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) { php_sxe_object *sxe; char *contents = NULL; @@ -1579,9 +1579,6 @@ static int sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_f if (type == IS_BOOL) { node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC); empty = node == NULL && zend_hash_num_elements(sxe_properties_get(readobj TSRMLS_CC)) == 0; - if (should_free) { - zval_dtor(readobj); - } INIT_PZVAL(writeobj); ZVAL_BOOL(writeobj, !empty); return SUCCESS; @@ -1606,10 +1603,6 @@ static int sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_f } } - if (should_free) { - zval_dtor(readobj); - } - rv = cast_object(writeobj, type, contents TSRMLS_CC); if (contents) { @@ -1655,7 +1648,7 @@ static zval *sxe_get_value(zval *z TSRMLS_DC) MAKE_STD_ZVAL(retval); - if (sxe_object_cast(z, retval, IS_STRING, 0 TSRMLS_CC)==FAILURE) { + if (sxe_object_cast(z, retval, IS_STRING TSRMLS_CC)==FAILURE) { zend_error(E_ERROR, "Unable to cast node to string"); /* FIXME: Should not be fatal */ } @@ -1848,11 +1841,7 @@ php_sxe_register_object(php_sxe_object *intern TSRMLS_DC) zend_object_value rv; rv.handle = zend_objects_store_put(intern, sxe_object_dtor, (zend_objects_free_object_storage_t)sxe_object_free_storage, sxe_object_clone TSRMLS_CC); - if (EG(ze1_compatibility_mode)) { - rv.handlers = (zend_object_handlers *) &sxe_ze1_object_handlers; - } else { - rv.handlers = (zend_object_handlers *) &sxe_object_handlers; - } + rv.handlers = (zend_object_handlers *) &sxe_object_handlers; return rv; } @@ -1962,7 +1951,7 @@ SXE_METHOD(__construct) long options = 0; zend_bool is_url = 0; - php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC); + php_set_error_handling(EH_THROW, zend_exception_get_default(TSRMLS_C) TSRMLS_CC); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lb", &data, &data_len, &options, &is_url) == FAILURE) { php_std_error_handling(); return; @@ -1974,7 +1963,7 @@ SXE_METHOD(__construct) if (!docp) { ((php_libxml_node_object *)sxe)->document = NULL; - zend_throw_exception(zend_exception_get_default(), "String could not be parsed as XML", 0 TSRMLS_CC); + zend_throw_exception(zend_exception_get_default(TSRMLS_C), "String could not be parsed as XML", 0 TSRMLS_CC); return; } @@ -2055,10 +2044,13 @@ static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRML return NULL; } -zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) +zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) { php_sxe_iterator *iterator = emalloc(sizeof(php_sxe_iterator)); + if (by_ref) { + zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); + } object->refcount++; iterator->intern.data = (void*)object; iterator->intern.funcs = &php_sxe_iterator_funcs; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 20d482ad9a..22931b6e4b 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -278,11 +278,7 @@ PHP_METHOD(SoapParam, SoapParam); /* SoapHeader Functions */ PHP_METHOD(SoapHeader, SoapHeader); -#ifdef ZEND_ENGINE_2 -#define SOAP_CTOR(class_name, func_name, arginfo, flags) ZEND_FENTRY(__construct, ZEND_FN(class_name##_##func_name), arginfo, flags) -#else #define SOAP_CTOR(class_name, func_name, arginfo, flags) PHP_ME(class_name, func_name, arginfo, flags) -#endif static zend_function_entry soap_functions[] = { #ifdef HAVE_PHP_DOMXML @@ -337,11 +333,7 @@ unsigned char __soap_call_args[] = { 5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYRE static zend_function_entry soap_client_functions[] = { SOAP_CTOR(SoapClient, SoapClient, NULL, 0) PHP_ME(SoapClient, __call, __call_args, 0) -#ifdef ZEND_ENGINE_2 - ZEND_FENTRY(__soapCall, ZEND_FN(SoapClient___call), __soap_call_args, 0) -#else - ZEND_NAMED_FE(__soapCall, ZEND_FN(SoapClient___call), __soap_call_args) -#endif + ZEND_NAMED_ME(__soapCall, ZEND_MN(SoapClient___call), __soap_call_args, 0) PHP_ME(SoapClient, __getLastRequest, NULL, 0) PHP_ME(SoapClient, __getLastResponse, NULL, 0) PHP_ME(SoapClient, __getLastRequestHeaders, NULL, 0) @@ -546,7 +538,7 @@ PHP_MINIT_FUNCTION(soap) zend_internal_function fe; fe.type = ZEND_INTERNAL_FUNCTION; - fe.handler = ZEND_FN(SoapClient___call); + fe.handler = ZEND_MN(SoapClient___call); fe.function_name = NULL; fe.scope = NULL; fe.fn_flags = 0; @@ -575,7 +567,7 @@ PHP_MINIT_FUNCTION(soap) /* Register SoapFault class */ INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions); #ifdef ZEND_ENGINE_2 - soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC); + soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC); #else soap_fault_class_entry = zend_register_internal_class(&ce TSRMLS_CC); #endif @@ -3055,7 +3047,7 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha if (fault_string != NULL) { add_property_string(obj, "faultstring", fault_string, 1); #ifdef ZEND_ENGINE_2 - zend_update_property_string(zend_exception_get_default(), obj, "message", sizeof("message")-1, fault_string TSRMLS_CC); + zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, fault_string TSRMLS_CC); #endif } if (fault_code != NULL) { diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index c3d585857a..30db0e0d7f 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -207,61 +207,61 @@ zend_function_entry sqlite_functions[] = { }; zend_function_entry sqlite_funcs_db[] = { - PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref) -/* PHP_ME_MAPPING(close, sqlite_close, NULL)*/ - PHP_ME_MAPPING(query, sqlite_query, third_arg_force_ref) - PHP_ME_MAPPING(queryExec, sqlite_exec, second_arg_force_ref) - PHP_ME_MAPPING(arrayQuery, sqlite_array_query, NULL) - PHP_ME_MAPPING(singleQuery, sqlite_single_query, NULL) - PHP_ME_MAPPING(unbufferedQuery, sqlite_unbuffered_query, third_arg_force_ref) - PHP_ME_MAPPING(lastInsertRowid, sqlite_last_insert_rowid, NULL) - PHP_ME_MAPPING(changes, sqlite_changes, NULL) - PHP_ME_MAPPING(createAggregate, sqlite_create_aggregate, NULL) - PHP_ME_MAPPING(createFunction, sqlite_create_function, NULL) - PHP_ME_MAPPING(busyTimeout, sqlite_busy_timeout, NULL) - PHP_ME_MAPPING(lastError, sqlite_last_error, NULL) - PHP_ME_MAPPING(fetchColumnTypes, sqlite_fetch_column_types, NULL) -/* PHP_ME_MAPPING(error_string, sqlite_error_string, NULL) static */ -/* PHP_ME_MAPPING(escape_string, sqlite_escape_string, NULL) static */ + PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref, 0) +/* PHP_ME_MAPPING(close, sqlite_close, NULL, 0)*/ + PHP_ME_MAPPING(query, sqlite_query, third_arg_force_ref, 0) + PHP_ME_MAPPING(queryExec, sqlite_exec, second_arg_force_ref, 0) + PHP_ME_MAPPING(arrayQuery, sqlite_array_query, NULL, 0) + PHP_ME_MAPPING(singleQuery, sqlite_single_query, NULL, 0) + PHP_ME_MAPPING(unbufferedQuery, sqlite_unbuffered_query, third_arg_force_ref, 0) + PHP_ME_MAPPING(lastInsertRowid, sqlite_last_insert_rowid, NULL, 0) + PHP_ME_MAPPING(changes, sqlite_changes, NULL, 0) + PHP_ME_MAPPING(createAggregate, sqlite_create_aggregate, NULL, 0) + PHP_ME_MAPPING(createFunction, sqlite_create_function, NULL, 0) + PHP_ME_MAPPING(busyTimeout, sqlite_busy_timeout, NULL, 0) + PHP_ME_MAPPING(lastError, sqlite_last_error, NULL, 0) + PHP_ME_MAPPING(fetchColumnTypes, sqlite_fetch_column_types, NULL, 0) +/* PHP_ME_MAPPING(error_string, sqlite_error_string, NULL, 0) static */ +/* PHP_ME_MAPPING(escape_string, sqlite_escape_string, NULL, 0) static */ {NULL, NULL, NULL} }; zend_function_entry sqlite_funcs_query[] = { - PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL) - PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL) - PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL) - PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL) - PHP_ME_MAPPING(column, sqlite_column, NULL) - PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL) - PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL) + PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL, 0) + PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL, 0) + PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL, 0) + PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL, 0) + PHP_ME_MAPPING(column, sqlite_column, NULL, 0) + PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL, 0) + PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL, 0) /* iterator */ - PHP_ME_MAPPING(current, sqlite_current, NULL) - PHP_ME_MAPPING(key, sqlite_key, NULL) - PHP_ME_MAPPING(next, sqlite_next, NULL) - PHP_ME_MAPPING(valid, sqlite_valid, NULL) - PHP_ME_MAPPING(rewind, sqlite_rewind, NULL) + PHP_ME_MAPPING(current, sqlite_current, NULL, 0) + PHP_ME_MAPPING(key, sqlite_key, NULL, 0) + PHP_ME_MAPPING(next, sqlite_next, NULL, 0) + PHP_ME_MAPPING(valid, sqlite_valid, NULL, 0) + PHP_ME_MAPPING(rewind, sqlite_rewind, NULL, 0) /* countable */ - PHP_ME_MAPPING(count, sqlite_num_rows, NULL) + PHP_ME_MAPPING(count, sqlite_num_rows, NULL, 0) /* additional */ - PHP_ME_MAPPING(prev, sqlite_prev, NULL) - PHP_ME_MAPPING(hasPrev, sqlite_has_prev, NULL) - PHP_ME_MAPPING(numRows, sqlite_num_rows, NULL) - PHP_ME_MAPPING(seek, sqlite_seek, NULL) + PHP_ME_MAPPING(prev, sqlite_prev, NULL, 0) + PHP_ME_MAPPING(hasPrev, sqlite_has_prev, NULL, 0) + PHP_ME_MAPPING(numRows, sqlite_num_rows, NULL, 0) + PHP_ME_MAPPING(seek, sqlite_seek, NULL, 0) {NULL, NULL, NULL} }; zend_function_entry sqlite_funcs_ub_query[] = { - PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL) - PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL) - PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL) - PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL) - PHP_ME_MAPPING(column, sqlite_column, NULL) - PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL) - PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL) + PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL, 0) + PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL, 0) + PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL, 0) + PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL, 0) + PHP_ME_MAPPING(column, sqlite_column, NULL, 0) + PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL, 0) + PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL, 0) /* iterator */ - PHP_ME_MAPPING(current, sqlite_current, NULL) - PHP_ME_MAPPING(next, sqlite_next, NULL) - PHP_ME_MAPPING(valid, sqlite_valid, NULL) + PHP_ME_MAPPING(current, sqlite_current, NULL, 0) + PHP_ME_MAPPING(next, sqlite_next, NULL, 0) + PHP_ME_MAPPING(valid, sqlite_valid, NULL, 0) {NULL, NULL, NULL} }; @@ -998,12 +998,15 @@ zend_object_iterator_funcs sqlite_query_iterator_funcs = { sqlite_iterator_rewind }; -zend_object_iterator *sqlite_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) +zend_object_iterator *sqlite_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) { sqlite_object_iterator *iterator = emalloc(sizeof(sqlite_object_iterator)); sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC); + if (by_ref) { + zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); + } object->refcount++; iterator->it.data = (void*)object; iterator->it.funcs = ce->iterator_funcs.funcs; diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 39c25b7059..f3e29f5e24 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -223,8 +223,8 @@ static zend_object_value tidy_object_new_exception(zend_class_entry * TSRMLS_DC) static zend_class_entry *tidy_get_ce_node(zval * TSRMLS_DC); static zend_class_entry *tidy_get_ce_doc(zval * TSRMLS_DC); static zval * tidy_instanciate(zend_class_entry *, zval * TSRMLS_DC); -static int tidy_doc_cast_handler(zval *, zval *, int, int TSRMLS_DC); -static int tidy_node_cast_handler(zval *, zval *, int, int TSRMLS_DC); +static int tidy_doc_cast_handler(zval *, zval *, int TSRMLS_DC); +static int tidy_node_cast_handler(zval *, zval *, int TSRMLS_DC); static void tidy_doc_update_properties(PHPTidyObj * TSRMLS_DC); static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type TSRMLS_DC); static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType * TSRMLS_DC); @@ -668,7 +668,7 @@ static zval * tidy_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC) return object; } -static int tidy_doc_cast_handler(zval *in, zval *out, int type, int free TSRMLS_DC) +static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC) { TidyBuffer output = {0}; PHPTidyObj *obj; @@ -700,7 +700,7 @@ static int tidy_doc_cast_handler(zval *in, zval *out, int type, int free TSRMLS_ return SUCCESS; } -static int tidy_node_cast_handler(zval *in, zval *out, int type, int free TSRMLS_DC) +static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC) { TidyBuffer buf = {0}; PHPTidyObj *obj; diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index e204fcbb39..0a29e51046 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -193,51 +193,51 @@ static zend_function_entry xmlwriter_functions[] = { #ifdef ZEND_ENGINE_2 /* {{{ xmlwriter_class_functions */ static zend_function_entry xmlwriter_class_functions[] = { - PHP_ME_MAPPING(openUri, xmlwriter_open_uri, NULL) - PHP_ME_MAPPING(openMemory, xmlwriter_open_memory, NULL) + PHP_ME_MAPPING(openUri, xmlwriter_open_uri, NULL, 0) + PHP_ME_MAPPING(openMemory, xmlwriter_open_memory, NULL, 0) #if LIBXML_VERSION >= 20605 - PHP_ME_MAPPING(setIndent, xmlwriter_set_indent, NULL) - PHP_ME_MAPPING(setIndentString, xmlwriter_set_indent_string, NULL) + PHP_ME_MAPPING(setIndent, xmlwriter_set_indent, NULL, 0) + PHP_ME_MAPPING(setIndentString, xmlwriter_set_indent_string, NULL, 0) #endif #if LIBXML_VERSION >= 20607 - PHP_ME_MAPPING(startComment, xmlwriter_start_comment, NULL) - PHP_ME_MAPPING(endComment, xmlwriter_end_comment, NULL) + PHP_ME_MAPPING(startComment, xmlwriter_start_comment, NULL, 0) + PHP_ME_MAPPING(endComment, xmlwriter_end_comment, NULL, 0) #endif - PHP_ME_MAPPING(startAttribute, xmlwriter_start_attribute, NULL) - PHP_ME_MAPPING(endAttribute, xmlwriter_end_attribute, NULL) - PHP_ME_MAPPING(writeAttribute, xmlwriter_write_attribute, NULL) + PHP_ME_MAPPING(startAttribute, xmlwriter_start_attribute, NULL, 0) + PHP_ME_MAPPING(endAttribute, xmlwriter_end_attribute, NULL, 0) + PHP_ME_MAPPING(writeAttribute, xmlwriter_write_attribute, NULL, 0) #if LIBXML_VERSION > 20617 - PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,NULL) - PHP_ME_MAPPING(writeAttributeNs, xmlwriter_write_attribute_ns,NULL) + PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,NULL, 0) + PHP_ME_MAPPING(writeAttributeNs, xmlwriter_write_attribute_ns,NULL, 0) #endif - PHP_ME_MAPPING(startElement, xmlwriter_start_element, NULL) - PHP_ME_MAPPING(endElement, xmlwriter_end_element, NULL) - PHP_ME_MAPPING(startElementNs, xmlwriter_start_element_ns, NULL) - PHP_ME_MAPPING(writeElement, xmlwriter_write_element, NULL) - PHP_ME_MAPPING(writeElementNs, xmlwriter_write_element_ns, NULL) - PHP_ME_MAPPING(startPi, xmlwriter_start_pi, NULL) - PHP_ME_MAPPING(endPi, xmlwriter_end_pi, NULL) - PHP_ME_MAPPING(writePi, xmlwriter_write_pi, NULL) - PHP_ME_MAPPING(startCdata, xmlwriter_start_cdata, NULL) - PHP_ME_MAPPING(endCdata, xmlwriter_end_cdata, NULL) - PHP_ME_MAPPING(writeCdata, xmlwriter_write_cdata, NULL) - PHP_ME_MAPPING(text, xmlwriter_text, NULL) - PHP_ME_MAPPING(startDocument, xmlwriter_start_document, NULL) - PHP_ME_MAPPING(endDocument, xmlwriter_end_document, NULL) - PHP_ME_MAPPING(writeComment, xmlwriter_write_comment, NULL) - PHP_ME_MAPPING(startDtd, xmlwriter_start_dtd, NULL) - PHP_ME_MAPPING(endDtd, xmlwriter_end_dtd, NULL) - PHP_ME_MAPPING(writeDtd, xmlwriter_write_dtd, NULL) - PHP_ME_MAPPING(startDtdElement, xmlwriter_start_dtd_element, NULL) - PHP_ME_MAPPING(endDtdElement, xmlwriter_end_dtd_element, NULL) - PHP_ME_MAPPING(writeDtdElement, xmlwriter_write_dtd_element, NULL) + PHP_ME_MAPPING(startElement, xmlwriter_start_element, NULL, 0) + PHP_ME_MAPPING(endElement, xmlwriter_end_element, NULL, 0) + PHP_ME_MAPPING(startElementNs, xmlwriter_start_element_ns, NULL, 0) + PHP_ME_MAPPING(writeElement, xmlwriter_write_element, NULL, 0) + PHP_ME_MAPPING(writeElementNs, xmlwriter_write_element_ns, NULL, 0) + PHP_ME_MAPPING(startPi, xmlwriter_start_pi, NULL, 0) + PHP_ME_MAPPING(endPi, xmlwriter_end_pi, NULL, 0) + PHP_ME_MAPPING(writePi, xmlwriter_write_pi, NULL, 0) + PHP_ME_MAPPING(startCdata, xmlwriter_start_cdata, NULL, 0) + PHP_ME_MAPPING(endCdata, xmlwriter_end_cdata, NULL, 0) + PHP_ME_MAPPING(writeCdata, xmlwriter_write_cdata, NULL, 0) + PHP_ME_MAPPING(text, xmlwriter_text, NULL, 0) + PHP_ME_MAPPING(startDocument, xmlwriter_start_document, NULL, 0) + PHP_ME_MAPPING(endDocument, xmlwriter_end_document, NULL, 0) + PHP_ME_MAPPING(writeComment, xmlwriter_write_comment, NULL, 0) + PHP_ME_MAPPING(startDtd, xmlwriter_start_dtd, NULL, 0) + PHP_ME_MAPPING(endDtd, xmlwriter_end_dtd, NULL, 0) + PHP_ME_MAPPING(writeDtd, xmlwriter_write_dtd, NULL, 0) + PHP_ME_MAPPING(startDtdElement, xmlwriter_start_dtd_element, NULL, 0) + PHP_ME_MAPPING(endDtdElement, xmlwriter_end_dtd_element, NULL, 0) + PHP_ME_MAPPING(writeDtdElement, xmlwriter_write_dtd_element, NULL, 0) #if LIBXML_VERSION > 20608 - PHP_ME_MAPPING(startDtdAttlist, xmlwriter_start_dtd_attlist, NULL) - PHP_ME_MAPPING(endDtdAttlist, xmlwriter_end_dtd_attlist, NULL) - PHP_ME_MAPPING(writeDtdAttlist, xmlwriter_write_dtd_attlist, NULL) + PHP_ME_MAPPING(startDtdAttlist, xmlwriter_start_dtd_attlist, NULL, 0) + PHP_ME_MAPPING(endDtdAttlist, xmlwriter_end_dtd_attlist, NULL, 0) + PHP_ME_MAPPING(writeDtdAttlist, xmlwriter_write_dtd_attlist, NULL, 0) #endif - PHP_ME_MAPPING(outputMemory, xmlwriter_output_memory, NULL) - PHP_ME_MAPPING(flush, xmlwriter_flush, NULL) + PHP_ME_MAPPING(outputMemory, xmlwriter_output_memory, NULL, 0) + PHP_ME_MAPPING(flush, xmlwriter_flush, NULL, 0) {NULL, NULL, NULL} }; /* }}} */ diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index e83a9728a1..3696a21566 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1220,7 +1220,7 @@ int main(int argc, char *argv[]) zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, arg); if (EG(exception)) { - zval *msg = zend_read_property(zend_exception_get_default(), EG(exception), "message", sizeof("message")-1, 0 TSRMLS_CC); + zval *msg = zend_read_property(zend_exception_get_default(TSRMLS_C), EG(exception), "message", sizeof("message")-1, 0 TSRMLS_CC); zend_printf("Exception: %s\n", Z_STRVAL_P(msg)); zval_ptr_dtor(&EG(exception)); EG(exception) = NULL; |